[PATCH] D40549: [ELF] - Add support for --just-symbols flag.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 04:56:03 PST 2017


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

This is "Bug 35067 - support --just-symbols (-R)" (https://bugs.llvm.org//show_bug.cgi?id=35067)

Description of feature:
--just-symbols=filename
Read symbol names and their addresses from filename, but do not relocate it or include it in the output.
This allows your output file to refer symbolically to absolute locations of memory defined in other programs.
You may use this option more than once. 
(ftp://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html)

Patch implements --just-symbols flag. Behavior is to read symbols from file and
add all of them as absolute symbols except undefined symbols, which are kept as undefined.

Only executable and relocatable files are supported as arguments. Both gnu linkers does not support
adding DSO files. Behavior of GNU linkers restricting DSO inputs is probably reasonable, though that looks
like artifical limitation. I can imagine DSO with absolute symbols and see no problems to extract
and use such symbols. This implementation follows GNU linkers behavior mostly for simplicity and consistency
of our implementation.


https://reviews.llvm.org/D40549

Files:
  ELF/Config.h
  ELF/Driver.cpp
  ELF/InputFiles.cpp
  ELF/InputFiles.h
  ELF/Options.td
  test/ELF/just-symbols.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40549.124547.patch
Type: text/x-patch
Size: 6647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171128/ce94e1cc/attachment.bin>


More information about the llvm-commits mailing list