[PATCH] D15581: [ELF] - fixed not properly handled @GOTTPOFF relocation against local symbols.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 10:00:33 PST 2015


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.

This patch changes sequence of applying relocations, moving tls optimized relocation handling code before code for other locals.
Without that change relocation @GOTTPOFF against local symbol caused runtime error ("unrecognized reloc ...").
That change also should fix other tls optimized relocations, but I did not check them, thats a field for another patch.

R_X86_64_GOTTPOFF relocations agains locals can be found when linking against libc.a(malloc.o):
000000000036  000600000016 R_X86_64_GOTTPOFF 0000000000000000 __libc_tsd_MALLOC - 4
000000000131  000600000016 R_X86_64_GOTTPOFF 0000000000000000 __libc_tsd_MALLOC - 4
...

http://reviews.llvm.org/D15581

Files:
  ELF/InputSection.cpp
  ELF/OutputSections.cpp
  ELF/OutputSections.h
  test/ELF/tls-opt-local.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15581.43024.patch
Type: text/x-patch
Size: 8660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151216/f6dcf10d/attachment.bin>


More information about the llvm-commits mailing list