[PATCH] D22288: ldd: Add GotEntrySize/GotPltEntrySize to ELF target

H.J Lu via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 16:07:02 PDT 2016


hjl.tools created this revision.
hjl.tools added a reviewer: ruiu.
hjl.tools added a subscriber: llvm-commits.
hjl.tools set the repository for this revision to rL LLVM.
hjl.tools added a project: lld.

For x86-64 psABI, the entry size of .got and .got.plt sections is 8
bytes for both LP64 and ILP32.  Add GotEntrySize and GotPltEntrySize
to ELF target instead of using size of ELFT::uint.  Now we can generate
a simple working x32 executable:

[hjl at gnu-skl-1 pr28507]$ gcc -mx32 -B./  -o foo foo.o -Wl,-v
collect2 version 6.1.1 20160621 (Red Hat 6.1.1-3)
./ld -plugin /usr/libexec/gcc/x86_64-redhat-linux/6.1.1/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/6.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccSNGyqu.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf32_x86_64 -dynamic-linker /libx32/ld-linux-x32.so.2 -o foo /usr/lib/gcc/x86_64-redhat-linux/6.1.1/../../../../libx32/crt1.o /usr/lib/gcc/x86_64-redhat-linux/6.1.1/../../../../libx32/crti.o /usr/lib/gcc/x86_64-redhat-linux/6.1.1/x32/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/6.1.1/x32 -L/usr/lib/gcc/x86_64-redhat-linux/6.1.1/../../../../libx32 -L/lib/../libx32 -L/usr/lib/../libx32 -L.  -L/usr/lib/gcc/x86_64-redhat-linux/6.1.1 -L/usr/lib/gcc/x86_64-redhat-linux/6.1.1/../../.. foo.o -v -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/6.1.1/x32/crtend.o /usr/lib/gcc/x86_64-redhat-linux/6.1.1/../../../../libx32/crtn.o
LLD 3.9 (ssh://llvm@gnu-4.sc.intel.com/export/server/git/llvm/lld 96b35f25c4f2253e9be5b814913106ec072a84d9)
[hjl at gnu-skl-1 pr28507]$ ./foo
hello
[hjl at gnu-skl-1 pr28507]$

Repository:
  rL LLVM

http://reviews.llvm.org/D22288

Files:
  ELF/OutputSections.cpp
  ELF/Symbols.cpp
  ELF/Target.cpp
  ELF/Target.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22288.63747.patch
Type: text/x-patch
Size: 4103 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160712/752a0191/attachment.bin>


More information about the llvm-commits mailing list