[PATCH] D55550: [LLD][ELF] - Fix the different behavior of the linker script symbols on different platforms.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 11 02:16:49 PST 2018


grimar created this revision.
grimar added reviewers: ruiu, psmith.
Herald added subscribers: arichardson, emaste, srhines.
Herald added a reviewer: espindola.

This should help make D55423 <https://reviews.llvm.org/D55423> be even more simple and also
fixes the broken behavior shown in one of our test cases
for some targets, like x86-64.

The issue occurs when the forward declarations are used in the script.
One of the samples is:

  SECTIONS {
    foo = ADDR(.text) - ABSOLUTE(ADDR(.text));
  };

In that case, we have a broken output when output target does
not use thunks. That happens because thunks creating code
calls `Script->assignAddresses()` at least once one more time,
what fixups the values.

In this patch, I generalize and rename `maybeAddThunks` to be used
by all targets.


https://reviews.llvm.org/D55550

Files:
  ELF/Writer.cpp
  test/ELF/linkerscript/addr-zero.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55550.177672.patch
Type: text/x-patch
Size: 5046 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181211/d934984c/attachment.bin>


More information about the llvm-commits mailing list