This is an archive of the discontinued LLVM Phabricator instance.

ELF2: Fix BSD's __progname symbol issue.
ClosedPublic

Authored by ruiu on Oct 11 2015, 10:37 AM.

Details

Reviewers
emaste
rafael
Summary

BSD's DSO files have undefined symbol "__progname" which is defined in crt1.o.
On that system, both user programs and system shared libraries depend on each
other. We need to put symbols defined by user programs which are referenced
by shared libraries to user program's .dynsym.

Diff Detail

Event Timeline

ruiu updated this revision to Diff 37059.Oct 11 2015, 10:37 AM
ruiu retitled this revision from to ELF2: Fix BSD's __progname symbol issue..
ruiu updated this object.
ruiu added reviewers: rafael, emaste.
ruiu added a subscriber: llvm-commits.
ruiu added a comment.Oct 11 2015, 11:39 AM

Why COPY relocation is related to this?

ruiu added a comment.Oct 11 2015, 11:58 AM

I was trying to write the comment concretely to help readers understand the
problem, but that may read that the issue would be limited to __progname.
I'll update the comment. Thank you for the advice.

ruiu updated this revision to Diff 37063.Oct 11 2015, 2:12 PM

Update a comment.

emaste edited edge metadata.Oct 11 2015, 6:46 PM

With this change I'm able to link a Hello world on FreeBSD.

ruiu updated this revision to Diff 37185.Oct 12 2015, 3:01 PM
ruiu edited edge metadata.

Rebased on HEAD

rafael accepted this revision.Oct 13 2015, 9:27 AM
rafael edited edge metadata.

LGTM with a nit.

test/elf2/progname.s
8

Don't include the numerical value (58). It is not stable.

This revision is now accepted and ready to land.Oct 13 2015, 9:27 AM
emaste closed this revision.Oct 28 2015, 6:42 PM

Committed in rL250176