[PATCH] D35651: [ELF] Align the value if needed when computing the expression

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 23:43:47 PDT 2017


phosek added a comment.

Added a test case, which revealed another issue: while trying `PROVIDE_HIDDEN(newsym = ALIGN(_end, CONSTANT(MAXPAGESIZE)) + 5);`, I noticed it was working fine in our project but not in LLD. Turned the problem is that we also use a linker script which defines `PROVIDE_HIDDEN(_end = .)`. However, when using only input linker script, this breaks because LLD only finalizes the `_end` value in `fixPredefinedSymbols` after all symbol assignment commands have been processed, so `newsym` will get  a wrong value. This change still fixes the case when script is being used.


Repository:
  rL LLVM

https://reviews.llvm.org/D35651





More information about the llvm-commits mailing list