This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Proccess 'extern' keyword in version scripts.
AbandonedPublic

Authored by grimar on Jun 22 2016, 6:27 AM.

Details

Reviewers
ruiu
rafael
Summary

During investigation about FreeBsd scripts I found that few of them uses
'extern' keyword. This patch just reads all globals inside as regular ones.

Note: I downloaded FreeBsd sources and tried to link with every *.map file in batch mode,
some of them are not script files, so I had to skip them manually.
Seems that this one in combination with D21556 allows to parse all available
FreeBsd version scripts.

Diff Detail

Event Timeline

grimar updated this revision to Diff 61539.Jun 22 2016, 6:27 AM
grimar retitled this revision from to [ELF] - Proccess 'extern' keyword in version scripts..
grimar updated this object.
grimar added reviewers: rafael, ruiu.
grimar added subscribers: llvm-commits, grimar.
rafael edited edge metadata.Jun 22 2016, 7:03 AM
rafael added a subscriber: rafael.

I am not sure it is a good idea to ignore these. 'extern "C++"' forces
the linker to match against mangled names. What is using it in freebsd
and what is it trying to match?

Cheers,
Rafael

Here is that script file: https://github.com/freebsd/freebsd/blob/master/gnu/lib/libsupc%2B%2B/Version.map

libsupc++ in the FreeBSD base system is only built on GCC-using architectures (e.g. MIPS). It isn't built in the default toolchain configuration for Tier-1 architectures and for current efforts using lld to link FreeBSD on x86 or arm we don't need to worry about this.

grimar abandoned this revision.Jun 22 2016, 8:11 AM

rL273426 was committed instead.