[PATCH] D41770: Rewrite our relocation processing

Rafael Avila de Espindola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 08:55:41 PST 2018


espindola created this revision.
espindola added reviewers: ruiu, grimar, atanasyan, smeenai.
Herald added subscribers: arichardson, javed.absar, sdardis, emaste.

This splits relocation processing in two steps.

First, analyze what needs to be done at the relocation spot. This can be a constant (non preemptible symbol, relative got reference, etc) or require a dynamic relocation. At this step we also consider creating copy relocations.

Once that is done we decide if we need a got or a plt entry.

The code is simpler IMHO. For example:

- There is a single call to isPicRel since the logic is not split among adjustExpr and the caller.
- R_MIPS_GOTREL is simple to handle now.
- The tracking of what is preemptible or not is much simpler now.

This also fixes a regression with symbols being both in a got and copy relocated. They had regressed in r268668 and r268149.

The other test changes are because of error messages changes or the order of two relocations in the output.

I will benchmark and report.


https://reviews.llvm.org/D41770

Files:
  ELF/Relocations.cpp
  test/ELF/aarch64-fpic-adr_prel_lo21.s
  test/ELF/aarch64-fpic-adr_prel_pg_hi21.s
  test/ELF/got32-i386-pie-rw.s
  test/ELF/i386-got-and-copy.s
  test/ELF/mips-got-and-copy.s
  test/ELF/x86-64-dyn-rel-error.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41770.128753.patch
Type: text/x-patch
Size: 21969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180105/eea1ce64/attachment-0001.bin>


More information about the llvm-commits mailing list