[PATCH] D64327: [ELF] Loose condition for relocation with a symbol

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 22:42:20 PDT 2019


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

I have tried the reproduce on http://sourceware.org/PR16794 with binutils 2.26 (2016) and it works:

  % /tmp/p/binutils-2.26/Release/gold/ld-new @response.txt
  % ./a.out 
  xabcde
  abcde

I cannot test the gold shipped with binutils 2.25 (2014) because it doesn't support R_386_GOT32X

  % /tmp/p/binutils-2.25/Release/gold/ld-new @response.txt
  /tmp/p/binutils-2.25/Release/gold/ld-new: error: usr/lib/i386-linux-gnu/crti.o: unsupported reloc 43 against global symbol __gmon_start__
  /tmp/p/binutils-2.25/Release/gold/ld-new: error: usr/lib/gcc/x86_64-linux-gnu/7/32/crtbeginS.o: unsupported reloc 43 against global symbol _ITM_deregisterTMCloneTable
  /tmp/p/binutils-2.25/Release/gold/ld-new: error: usr/lib/gcc/x86_64-linux-gnu/7/32/crtbeginS.o: unsupported reloc 43 against global symbol _ITM_registerTMCloneTable
  /tmp/p/binutils-2.25/Release/gold/ld-new: error: usr/lib/gcc/x86_64-linux-gnu/7/32/crtbeginS.o: unsupported reloc 43 against global symbol __cxa_finalize
  usr/lib/i386-linux-gnu/crti.o(.init+0x11): error: unsupported reloc 43
  usr/lib/gcc/x86_64-linux-gnu/7/32/crtbeginS.o(.text+0x1d): error: unsupported reloc 43
  usr/lib/gcc/x86_64-linux-gnu/7/32/crtbeginS.o(.text+0x70): error: unsupported reloc 43
  usr/lib/gcc/x86_64-linux-gnu/7/32/crtbeginS.o(.text+0xad): error: unsupported reloc 43

The status is good enough. The bug probably only existed in some pre-2014 version of gold. Maintaining the workaround harms code size, so LG.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64327/new/

https://reviews.llvm.org/D64327





More information about the llvm-commits mailing list