Displaying 20 results from an estimated 38 matches for "getsection".
2012 Jun 12
4
[LLVMdev] Questions about llvm/Object/COFF.h
...tly, you're supposed to write.
for (llvm::object::section_iterator iter = Obj.begin_sections (); iter != Obj.end_sections(); iter.increment(ec))
Srsly?
[ And - how do I go from a section_iterator to a coff_section ? ]
While I'm puzzling over that, I look some more, and I see:
error_code getSection(int32_t index, const coff_section *&Res) const;
Cool. (A bit weird; why a signed index?, but whatever)
So I write:
const llvm::object::coff_section *sect;
for (std::size_t i = 0; i < NumSections; ++i)
Obj.getSection(i, sect);
And my program dies with a segmentation fault.
Turns out...
2011 Mar 18
2
[LLVMdev] Text or Data symbol
...e lowering stage and also at the AsmPrinter stage,
I need to know if a GlobalAddress is a code or a data address.
So I tried at the lowering stage to use:
GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op);
const GlobalValue *GV = GSDN->getGlobal();
GV->hasSection() and GV->getSection()
But the section is not set at this stage (hasSection = false)
And at the AsmPrinter stage:
const GlobalValue *GV = MO.getGlobal();
SectionKind sectionKind = Mang->getSymbol(GV)->getSection().getKind();
But again the section does not seem to be set (sectionKind.isInSection() =
false)
Do yo...
2011 Mar 21
0
[LLVMdev] Text or Data symbol
...the AsmPrinter stage,
> I need to know if a GlobalAddress is a code or a data address.
>
> So I tried at the lowering stage to use:
> GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op);
> const GlobalValue *GV = GSDN->getGlobal();
> GV->hasSection() and GV->getSection()
> But the section is not set at this stage (hasSection = false)
>
> And at the AsmPrinter stage:
> const GlobalValue *GV = MO.getGlobal();
> SectionKind sectionKind = Mang->getSymbol(GV)->getSection().getKind();
> But again the section does not seem to be set (sectionKind....
2012 Jun 12
0
[LLVMdev] Questions about llvm/Object/COFF.h
...for (llvm::object::section_iterator iter = Obj.begin_sections ();
> iter != Obj.end_sections(); iter.increment(ec))
> Srsly?
> [ And - how do I go from a section_iterator to a coff_section ? ]
>
> While I'm puzzling over that, I look some more, and I see:
> error_code getSection(int32_t index, const coff_section *&Res)
> const;
>
> Cool. (A bit weird; why a signed index?, but whatever)
> So I write:
> const llvm::object::coff_section *sect;
> for (std::size_t i = 0; i < NumSections; ++i)
> Obj.getSection(i, sect);
&g...
2011 Mar 21
1
[LLVMdev] Text or Data symbol
..., I need to know if a GlobalAddress is a code or a
> data address.
>
> So I tried at the lowering stage to use:
> GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op);
> const GlobalValue *GV = GSDN->getGlobal();
> GV->hasSection() and GV->getSection()
> But the section is not set at this stage (hasSection = false)
>
> And at the AsmPrinter stage:
> const GlobalValue *GV = MO.getGlobal();
> SectionKind sectionKind = Mang->getSymbol(GV)->getSection().getKind();
> But again the section does not seem to...
2012 Jun 12
0
[LLVMdev] Questions about llvm/Object/COFF.h
...art of the interface is private to COFFObject. COFFObject itself
isn't really designed to be used with the generic interface, although
I'm very open to a better design that allows this in a sane way.
> While I'm puzzling over that, I look some more, and I see:
> error_code getSection(int32_t index, const coff_section *&Res) const;
>
> Cool. (A bit weird; why a signed index?, but whatever)
> So I write:
> const llvm::object::coff_section *sect;
> for (std::size_t i = 0; i < NumSections; ++i)
> Obj.getSection(i, sect);
>
&g...
2011 Oct 13
0
[LLVMdev] llvm-objdump related patch
...DataRefImpl Symb,
bool &Result) const {
- // FIXME: Unimplemented.
+
Result = false;
+ const Elf_Sym *sym = getSymbol(Symb);
+ const Elf_Shdr *sec = reinterpret_cast<const Elf_Shdr *>(Sec.p);
+
+ if (getSection(sym->st_shndx) != sec) {
This version of getSection will not handle extended section indices
properly. Use the version that takes a const Elf_Sym*. This also fails
when there is no section table, which is not required for executables
or shared libraries.
+ Result = false;
+ return object...
2011 Oct 12
2
[LLVMdev] llvm-objdump related patch
Michael,
I have rework the patch according to your suggestion. And I have
read binutil/objdump source code and found that it has a logic that if
there's no symtab, it will use dynsym, which is missing in llvm-objdump.
Songmao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-the-address-calculation-for-llvm-objdump.patch
Type: text/x-patch
2009 Jul 20
2
[LLVMdev] PIC16TargetAsmInfo::getBSSSectionForGlobal
...Sanjiv,
The PIC16TargetAsmInfo::getBSSSectionForGlobal apparently does magic
that reinterprets the "section" field of a global in a strange way:
// If GV has a sectin name or section address create that section
now.
if (GV->hasSection()) {
std::string SectName = GV->getSection();
// If address for a variable is specified, get the address and
create
// section.
std::string AddrStr = "Address=";
if (SectName.compare(0, AddrStr.length(), AddrStr) == 0) {
std::string SectAddr = SectName.substr(AddrStr.length());
S = CreateSection...
2008 Oct 13
0
[LLVMdev] api changes in llvm 2.4
Hello, Pekka
> 12) getSectionForFunction(*f) to f->getSection()
This is not a correct substitution. Function::getSection() returns
section set on function explicitely, getSectionForFunction() calculated
desired section name, where function should be emitted into (for
example, unique function name for linkonce stuff).
getSec...
2011 Nov 17
1
[LLVMdev] How to get ELF section virtual starting address from MCSymbolRefExpr?
...t it could be any section.
I can get a MCSectionELF class object from MCSymbol that I get from MCSymbolRefExpr:
int Kind = Value->getKind();
if (Kind == MCExpr::SymbolRef) {
const MCSymbol &Sym = SRE->getSymbol();
const MCSectionELF = dyn_cast_or_null<MCSectionELF>(Sym.getSection());
}
But can't see how to get the virtual address of the section. This is odd since I would have expected methods for accessing every part of the ELF section header entry.
How does one get the virtual address (sh_addr in ELF) starting from a MCSymbolRefExpr?
Thanks,
Jack
-------------- n...
2004 May 22
1
Failure while compiling
Hi guys!
I just try to compile Asterisk with "make all" and get the following
lines multible times:
cli.c:31:19: build.h: No such file or directory
dlfcn.c:40:25: mach-o/dyld.h: No such file or directory
dlfcn.c:41:26: mach-o/nlist.h: No such file or directory
dlfcn.c:42:28: mach-o/getsect.h: No such file or directory
Can someone tell me what's exactly missing?
2012 Jun 13
1
[LLVMdev] Questions about llvm/Object/COFF.h
...private to COFFObject. COFFObject itself
> isn't really designed to be used with the generic interface, although
> I'm very open to a better design that allows this in a sane way.
>
> > While I'm puzzling over that, I look some more, and I see:
> > error_code getSection(int32_t index, const coff_section *&Res)
> const;
> >
> > Cool. (A bit weird; why a signed index?, but whatever)
> > So I write:
> > const llvm::object::coff_section *sect;
> > for (std::size_t i = 0; i < NumSections; ++i)
> >...
2009 Jul 20
0
[LLVMdev] PIC16TargetAsmInfo::getBSSSectionForGlobal
...mInfo::getBSSSectionForGlobal apparently does magic
> that reinterprets the "section" field of a global in a strange way:
>
> // If GV has a sectin name or section address create that section
> now.
> if (GV->hasSection()) {
> std::string SectName = GV->getSection();
> // If address for a variable is specified, get the address and
> create
> // section.
> std::string AddrStr = "Address=";
> if (SectName.compare(0, AddrStr.length(), AddrStr) == 0) {
> std::string SectAddr = SectName.substr(AddrStr.length(...
2008 Oct 13
0
[LLVMdev] api changes in llvm 2.4
...with InstructionSelect()
11) no matching function for call to
llvm::AsmPrinter::AsmPrinter(std::basic_ostream<char,
std::char_traits<char>...
The stream argument has been changed to llvm::raw_ostream
Also had to change std::endls to '\n' in the AssemblyPrinter.
12) getSectionForFunction(*f) to f->getSection()
13) TargetLowering::LowerArguments() fingerprint changed
It now takes the SmallVectorImpl<SDValue>& argValues as an
output reference parameter and is a void function.
14) TargetLowering::LowerCallTo() has an additional
bool argument isInreg
BR...
2008 Oct 11
2
[LLVMdev] api changes in llvm 2.4
In the 2.3 release, we included a list of the major LLVM API changes.
If you are working on upgrading your code from 2.3 to 2.4, I'd
appreciate it if you could compile a list of the major stumbling
blocks you have, so that others can benefit from your experience.
Please send any info to the list, thanks!
-Chris
2010 Jul 27
2
[LLVMdev] Failed to build llvm with gcc 4.3.4 on Solaris x86
Hi,
You asked for bug reports on failed build/platforms combinations, here is one:
——————
.
.
.
llvm[3]: Compiling TestMain.cpp for Debug+Asserts build
llvm[3]: Building Debug+Asserts Archive Library libUnitTestMain.a
gmake[3]: Leaving directory `/home/jocke/gcd/llvm/utils/unittest/UnitTestMain'
gmake[2]: Leaving directory `/home/jocke/gcd/llvm/utils/unittest'
gmake[1]: Leaving directory
2011 Jul 06
1
[LLVMdev] clang-llvm exceptions problem powerpc-apple-darwin
...F = getObjFileLowering();
const MCExpr *Exp =
TLOF.getExprForDwarfReference(Sym, Mang, MMI, Encoding,
OutStreamer);
const MCSectionMachO * SecCur = dyn_cast<MCSectionMachO>
(getCurrentSection());
const MCSectionMachO * SecRef = dyn_cast<MCSectionMachO>(&Sym-
>getSection());
#if 0
OutStreamer.EmitAbsValue(Exp, GetSizeOfEncodedValue(Encoding));
#elif 0
if (SecRef->getType() == MCSectionMachO::S_COALESCED)
OutStreamer.EmitValue(Exp, GetSizeOfEncodedValue(Encoding));
else
OutStreamer.EmitAbsValue(Exp, GetSizeOfEncodedValue(Encoding));
#else
i...
2010 May 02
0
[LLVMdev] Win32 COFF Support
...et/compiler-specific defines
outside of libSystem.
> struct MCWin32CoffObjectWriter :
> MCObjectWriter,
> coff::file
Any reason for such inheritance?
> MCSectionCOFF const & Section = dynamic_cast <MCSectionCOFF const &> (SectionData.getSection ());
LLVM normally compiles w/o RTTI, so this won't work
> CoffSection->Header.Characteristics |=
> coff::IMAGE_SCN_CNT_CODE |
> coff::IMAGE_SCN_MEM_READ...
2009 Jul 20
2
[LLVMdev] PIC16TargetAsmInfo::getBSSSectionForGlobal
...ForGlobal apparently does magic
>> that reinterprets the "section" field of a global in a strange way:
>>
>> // If GV has a sectin name or section address create that section
>> now.
>> if (GV->hasSection()) {
>> std::string SectName = GV->getSection();
>> // If address for a variable is specified, get the address and
>> create
>> // section.
>> std::string AddrStr = "Address=";
>> if (SectName.compare(0, AddrStr.length(), AddrStr) == 0) {
>> std::string SectAddr = SectName.sub...