Page MenuHomePhabricator

[ELF] - Add support for --just-symbols flag.

Authored by grimar on Nov 28 2017, 4:56 AM.



This is "Bug 35067 - support --just-symbols (-R)" (

Description of feature:
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.

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.

Diff Detail

Event Timeline

grimar created this revision.Nov 28 2017, 4:56 AM
phosek added a subscriber: phosek.Nov 28 2017, 11:48 AM

FYI @ruiu has already wrote a similar patch in D39348.

FYI @ruiu has already wrote a similar patch in D39348.

I did not see it :( Thanks.

grimar abandoned this revision.Dec 3 2017, 11:09 PM

Abdndoned in favor of D39348.