[PATCH] D36579: [ELF] - Do not fail when set versions for linkerscript's symbol aliases

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 07:00:17 PDT 2017


grimar created this revision.
Herald added a subscriber: emaste.

This is PR34121,

previously we would fail on following:

% cat sym.c
void f() {}

% cat sym.script
g = f;
VERSION { V1 { global: f; g; local: *; }; }

% clang -fPIC -c sym.c
% ld.lld -shared -o libsym.so sym.o sym.script --no-undefined-version
ld.lld: error: version script assignment of 'V1' to symbol 'g' failed: symbol not defined

That happened because at the point of proccessing symbol versions, symbol `g` was
not yet created. Patch changes logic to create undefined symbols referenced by script
earlier, so we are able to assing version correctly.


https://reviews.llvm.org/D36579

Files:
  ELF/Driver.cpp
  ELF/ScriptParser.cpp
  ELF/SymbolTable.cpp
  test/ELF/linkerscript/align.s
  test/ELF/linkerscript/symbols-synthetic.s
  test/ELF/linkerscript/version-script.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36579.110573.patch
Type: text/x-patch
Size: 7313 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170810/de2aafb2/attachment.bin>


More information about the llvm-commits mailing list