[PATCH] D62141: [ELF] -z combreloc: sort dynamic relocations by (!is_relative,symbol_index,r_offset)

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 07:25:13 PDT 2019


MaskRay created this revision.
MaskRay added reviewers: gribozavr, grimar, ruiu.
Herald added subscribers: llvm-commits, arphaman, kristof.beyls, arichardson, javed.absar, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

We currently sort dynamic relocations by (!is_relative,symbol_index).
Add r_offset as the third key. This makes `readelf -r` debugging easier
(relocations to the same symbol are ordered by r_offset).

Refactor the test combreloc.s (renamed from combrelocs.s) to check
R_X86_64_RELATIVE, and delete --expand-relocs.

The difference from the reverted D61477 <https://reviews.llvm.org/D61477> is that we add !is_relative as
the first key. In local dynamic TLS model, DTPMOD (e.g.
R_ARM_TLS_DTPMOD32 R_X86_64_DTPMOD and R_PPC{,64}_DTPMOD) may use 0 as
the symbol index.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D62141

Files:
  ELF/SyntheticSections.cpp
  test/ELF/combreloc.s
  test/ELF/combrelocs.s
  test/ELF/i386-got-and-copy.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62141.200277.patch
Type: text/x-patch
Size: 6762 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190520/c6198c0a/attachment.bin>


More information about the llvm-commits mailing list