[PATCH] D25441: [ELF] Make symbols containing ADDR() function synthetic.

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 10:53:04 PDT 2016


evgeny777 created this revision.
evgeny777 added reviewers: ruiu, rafael.
evgeny777 added subscribers: grimar, ikudrin, llvm-commits.
evgeny777 set the repository for this revision to rL LLVM.
evgeny777 added a project: lld.

This conform to gold/ld behavior and makes it much easier to define section based symbols. Below is an example:

  a = ADDR(,rela.plt) + 1;  /* Creates section defined symbol based on .rela_plt with value 1 */
  b = ADDR(,rela.plt) - 1; /* Same as above, but value is -1 */
  c = ADDR(,rela.plt) * 2; /* Creates absolute symbol with value 2*(.rela.plt VA) */

Such symbols can be defined even without SECTIONS block.


Repository:
  rL LLVM

https://reviews.llvm.org/D25441

Files:
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  test/ELF/linkerscript/symbols-synthetic.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25441.74145.patch
Type: text/x-patch
Size: 7426 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161010/028f7e52/attachment.bin>


More information about the llvm-commits mailing list