[PATCH] D22759: [ELF] Linkerscript: symbol assignments with indentifiers on the right side of expression.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 09:09:09 PDT 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.
Herald added a subscriber: emaste.

In symbol assignments symbol may appear on the right-hand side of the expression:
(https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l8)
```
 /* Read-only sections, merged into text segment: */
kernphys = CONSTANT (MAXPAGESIZE);
 . = kernbase + kernphys + SIZEOF_HEADERS;
```

Patch implements that.

Patch is little but I had to use a bit unusual (for lld) solution,
see class ExpressionsBridge. Problem was that we need to access symtab from expressions
and expressions itself does not know anything about ELFT. So they need some way to get
a symbol value from symtab.
May be there is a nicer way to achieve that ?

https://reviews.llvm.org/D22759

Files:
  ELF/Driver.cpp
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  test/ELF/linkerscript/linkerscript-symbol-assignexpr.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22759.65352.patch
Type: text/x-patch
Size: 3754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160725/962c1b2d/attachment.bin>


More information about the llvm-commits mailing list