[llvm-commits] PATCH: lld ReaderELF.cpp update

Sid Manning sidneym at codeaurora.org
Fri Jul 13 11:44:30 PDT 2012


There are 3 attachments here for lld ELFReader support that I would like 
to get feedback on.

Thanks,


- make-get-Symbol-Section-public.diff:

This change makes getSymbol and getSection public.  These are used by 
ReaderELF to get access to symbol and section information.  The 
ElfReader requires this change or it will not compile.  Because ELF.h is 
in a different repository I made a different patch for it.


- add-ElfReader-and-tests.diff:

This is an updated version of Hemant Kulkarni's original submission.  It 
uses the ELF structures directly, fills in some functions and hopefully 
follows the coding guidelines.

lld-core is modified to take a "-reader" argument.  This still defaults 
to YAML so the rest of the tests still run.  I added 2 binary object 
files, one i386 and one hexagon.  At the moment there is no YAML to ELF 
translator so these were added to handle interim testing.

The COFF reader needed to be tweaked - see 
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120625/145537.html. 
      There may be a better way to deal with COFF but this patch 
includes the above change because I wanted to verify that lld-core would 
work with a COFF object file.


- testInputs.tgz:
This tarball has 2 files that will expand to:
       test/elf/Inputs/object-test.elf-hexagon
       test/elf/Inputs/object-test.elf-i386

These samples were based on the code below, using some examples found in 
DefinedAtom.h. i386 was built with gcc -m32.  hexagon was built with gcc 
-mv4 -G0.

int common_symbol[0x100] __attribute__ ((aligned (16)));
void global_func() { puts ("global"); }
static void static_func() { puts ("static"); }
int global_variable = 1;
int tentative;
static int uninitialized_static_variable;
__attribute__((weak)) void weak_func() { puts ("weak"); }
__attribute__((visibility("hidden"))) void hidden_func() { puts("hidden"); }
__attribute__((used)) void no_dead_strip() {}
__attribute__((section ("special_section"))) void special_section_func() {}
void no_special_section_func() {}

I definitely see value of keeping tests in YAML but at the moment there 
is no ELF->YAML translator so this was the only way I could include test 
cases for the reader.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: make-get-Symbol-Section-public.diff
Type: text/x-patch
Size: 1121 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120713/b9ed0b7e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-ElfReader-and-tests.diff
Type: text/x-patch
Size: 27633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120713/b9ed0b7e/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testInputs.tgz
Type: application/x-compressed-tar
Size: 1169 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120713/b9ed0b7e/attachment-0002.bin>


More information about the llvm-commits mailing list