search for: elfobjectfil

Displaying 20 results from an estimated 28 matches for "elfobjectfil".

Did you mean: elfobjectfile
2017 Nov 13
4
How to objcopy via LLVM toolchain for armv7e-m ELF32LE?
Hi LLVM developers, As PR35281 mentioned: $ llvm-objcopy -O binary llvm-cortex-m7.elf llvm-cortex-m7.bin llvm-objcopy: 'llvm-cortex-m7.elf': The file was not recognized as a valid object file. if (ELFObjectFile<ELF64LE> *o = dyn_cast<ELFObjectFile<ELF64LE>>(&Binary)) https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/llvm-objcopy.cpp#L200 Please give me some hints about objcopy armv7e-m ELF32LE via LLVM toolchain, thanks a lot! -- Regards, Leslie Zhai - https:...
2012 Jan 23
1
[LLVMdev] ELFObjectFile changes, llvm-objdump showing 'wrong' values?
..._value means: "In relocatable files, st_value holds a section offset for a defined symbol. That is, > st_value is an offset from the beginning of the section that st_shndx identifies." (*) > > Therefore, when queried about a symbol's address what would the right answer be? In ELFObjectFile::getSymbolAddress, previously, it was simply symb->st_value (which is the relative offset to the section). Now, Section->sh_addr is added to reflect the actual address of the symbol. > > Ignoring for the moment the change this imposes on objdump & nm (which can be amended), what wo...
2012 Jan 23
0
[LLVMdev] ELFObjectFile changes, llvm-objdump showing 'wrong' values?
...table entry st_value means: "In relocatable files, st_value holds a section offset for a defined symbol. That is, st_value is an offset from the beginning of the section that st_shndx identifies." (*) Therefore, when queried about a symbol's address what would the right answer be? In ELFObjectFile::getSymbolAddress, previously, it was simply symb->st_value (which is the relative offset to the section). Now, Section->sh_addr is added to reflect the actual address of the symbol. Ignoring for the moment the change this imposes on objdump & nm (which can be amended), what would the...
2013 Jan 18
1
[LLVMdev] ELFObjectFile::getSymbolFileOffset
While working on some other changes I came across a problem where ELFObjectFile::getSymbolFileOffset was returning a different value than I expected in the case where the symbol in question was a section. Looking at the code, it seems obviously wrong, but I didn't want to just commit my change without at least asking if anyone knew of a good reason for the current behav...
2012 Jan 23
3
[LLVMdev] ELFObjectFile changes, llvm-objdump showing 'wrong' values?
Hi all, I'm using the MC framework for a project, and while updating to latest trunk (r148672) encountered the following issue: It seems that SymbolRef::getAddress and SymbolRef::getFileOffset have been changed to add the symbol's offset to the offset of the containing section? This has the following implications: To get the /actual/ fileoffset, I now need to do: Symbol.getFileOffset()
2011 Oct 13
0
[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 > @@ -747,12 +747,28 @@ error_code ELFObjectFile<target_endianness, is64Bits> template<support::endianness target_endianness, bool is64Bits> error_code ELFObjectFile<target_endianness, is64Bits> ::sectionContainsSymbol(DataRefImpl Sec, DataRefImpl S...
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
2014 Feb 26
2
[LLVMdev] [lld] Relocation reading refactoring
...auto *ERef = new (_readerStorage) > ELFReference<ELFT>(ri, ri->r_offset - symbol->st_value, nullptr); > + // Read the addend from the section contents > + // TODO : We should move the way lld reads relocations totally from > + // ELFObjectFile > + int32_t addend = *(content.data() + ri->r_offset - symbol->st_value); > + ERef->setAddend(addend); > _references.push_back(ERef); > } What do you mean by removing relocation reading from the ELFObjectFile? I considered to customize th...
2015 Aug 25
3
Modifying objects with MC
...section within that ELF file based on the data contained within another section. Using llvm-objdump as a template of how to read an object file, I've been able to read the latter section that tells me what to edit, but I haven't found a way to edit the former, as everything in the MCSection/ELFObjectFile/SectionRef classes seem to be read-only as far as section contents are concerned. The changes I would want to make don't change the size of any section, all I need to do is for example zero the first n bytes of .text whilst keeping the rest of the object the same. What would be the recommende...
2011 Mar 31
1
[LLVMdev] [patch] Support PE/COFF in COFFObjectFile, fix some bugs object file readers
...of them. - Fixes a bug in the COFFObjectFile's support for the Microsoft COFF extension for long symbol names, wherein it was attempting to parse the leading '/' in an extended symbol name reference as part of the integer offset. - Fixes bugs in COFFObjectFile and ELFObjectFile wherein section and symbol iterators were being returned with uninitialized bytes; the type DataRefImpl is a union between 2 32-bit words (d.a and d.b) and a single intptr_t word (p). Only p was being initialized, so in 32-bit builds the result would be iterators with random up...
2014 Feb 26
2
[LLVMdev] [lld] Relocation reading refactoring
...e class would be constructed with > _relocationAddendReferences/_relocationReferences. > > Each subtarget could make use of the functionality and create a different > type of ELFReference on a need basis. [...] >> What do you mean by removing relocation reading from the >> ELFObjectFile? I considered to customize the relocation reading for >> MIPS targets and my first idea was to factor out ELFReference creation >> into a couple of virtual functions. The first one is for Elf_Rel, the >> second one is for Elf_Rela. Then I planned to override these functions >&...
2013 Sep 26
0
[LLVMdev] request for tutorial
...nting classes. I'd encourage anyone who has added a class to LLVM to revisit it and see if they can improve the documentation. Another example is object::ObjectFile. You can cast<> or dyn_cast<> these down to object::COFFObjectFiles or object::MachOObjectFiles easily, but object::ELFObjectFile is a template class and there's no documentation of what the template parameter should be, of it if's possible to infer it from the object::ObjectFile somehow. David Who has spent the last week writing a tool that uses the MC layer and found the lack of documentation frustrating [1] ht...
2012 Jan 09
1
[LLVMdev] Implementing the MC-JIT execution path for ELF, with debugging
...I was granted "commit after approval" rights to the repo by Chris Lattner, and will start delivering patches to llvm-commits today. To make the review process manageable, we intend to split the patches into a few incremental parts: 1. Modifications (more precisely, extension) to ELFObjectFile (from libObject) to support dynamic loading 2. Implementation of MC-JIT for ELF, including a new RuntimeDyldELF class (that parallels the existing RuntimeDyldMachO) which implements the dynamic loading of the ELF image into memory, its relocation and execution. 3. An implementation o...
2016 Mar 24
1
[PATCH] D15965: Add support for dumping relocations in non-relocatable files
...dumping relocations in non-relocatable files On Mar 24, 2016 4:08 PM, "Colin LeMahieu" <colinl at codeaurora.org <mailto:colinl at codeaurora.org> > wrote: > > llvm-objdump wants to print the relocationOffset, so it calls RelocationRef::relocationOffset which calls ELFObjectFile::getRelocationOffset > > Since objdump wants the relocation offset, and this pipes down to ELFObjectFile::getRelocationOffset, at what point is the address supposed to be asked for? > In llvm-objdump. It can then search the sections to see if one happens to include that address. > --...
2015 Aug 27
2
Modifying objects with MC
...n the data contained within >> another section. Using llvm-objdump as a template of how to read an >> object file, I've been able to read the latter section that tells me >> what to edit, but I haven't found a way to edit the former, as >> everything in the MCSection/ELFObjectFile/SectionRef classes seem to be >> read-only as far as section contents are concerned. >> >> The changes I would want to make don't change the size of any section, >> all I need to do is for example zero the first n bytes of .text whilst >> keeping the rest of the...
2014 Mar 06
2
[LLVMdev] [lld] Relocation reading refactoring
...s/_relocationReferences. >>> >>> Each subtarget could make use of the functionality and create a different >>> type of ELFReference on a need basis. >> >> [...] >> >>>> What do you mean by removing relocation reading from the >>>> ELFObjectFile? I considered to customize the relocation reading for >>>> MIPS targets and my first idea was to factor out ELFReference creation >>>> into a couple of virtual functions. The first one is for Elf_Rel, the >>>> second one is for Elf_Rela. Then I planned to overri...
2013 Sep 25
4
[LLVMdev] request for tutorial
On 25 September 2013 22:13, Preston Briggs <preston.briggs at gmail.com> wrote: > A lot of my difficulty in reading other examples is that it's not clear > what matters and what doesn't. It's what I hope to get by sitting next to > someone and asking questions. Some of this could be addressed in a guide. > I'd start with a chapter on planning. > Another
2019 Mar 06
3
RFC: Adding "minidump" support to obj2yaml
...les, which have things like relocations, symbol lists, etc., and minidump streams have none of those. Therefore I'm leaning towards the option of just implementing this as a standalone MinidumpFile class. This would be kind of similar to the existing ELFFile class, only there wouldn't be an ELFObjectFile sitting on top of that. Please let me know what do you think, pavel
2013 Sep 06
0
[LLVMdev] Unreachable in llvm-nm in Debug mode
...in/workspace/llvm/bin/./llvm-nm -s /home/rengolin/workspace/llvm/test/Object/Output/archive-symtab.test.tmp.a trivial-object-test.elf-x86-64: U SomeOtherFunction 00000000 T main U puts Invalid alignment for ELF file! UNREACHABLE executed at /home/rengolin/devel/llvm/src/lib/Object/ELFObjectFile.cpp:67! Anyone else seeing this? cheers, --renato -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130906/837f41e9/attachment.html>
2013 Sep 06
0
[LLVMdev] Unreachable in llvm-nm in Debug mode
...m/test/Object/Output/archive-symtab.test.tmp.a >> trivial-object-test.elf-x86-64: >> U SomeOtherFunction >> 00000000 T main >> U puts >> Invalid alignment for ELF file! >> UNREACHABLE executed at >> /home/rengolin/devel/llvm/src/lib/Object/ELFObjectFile.cpp:67! >> >> Anyone else seeing this? >> > > http://llvm.org/bugs/show_bug.cgi?id=17056 > > -Eli > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130906/cf7c7e93/attachment...