This is an archive of the discontinued LLVM Phabricator instance.

[ELF2] - Linker script EXTERN implemented.
ClosedPublic

Authored by grimar on Oct 19 2015, 7:51 AM.

Details

Summary

The reason of collecting all undefines in vector is that during reading files we already need to have Symtab created. Or like was done in that patch - to put undefines from scripts somewhere to delay Symtab.addUndefinedOpt() call.

Actually the main problem I see here is that currently ELF type is taken from first file. If we could know it earlier (I am not sure, from command line may be ?) then we would not need such solutions.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 37755.Oct 19 2015, 7:51 AM
grimar retitled this revision from to [ELF2] - Linker script EXTERN implemented..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
ruiu added inline comments.Oct 19 2015, 8:26 AM
ELF/Driver.cpp
192–194 ↗(On Diff #37755)

Move this before OPT_z.

test/elf2/linkerscript.s
9–11 ↗(On Diff #37755)

This test does not actually verify that EXTERN() works in the same way as -u. I'd add one more test to undefined-opt.s.

grimar updated this revision to Diff 37770.Oct 19 2015, 10:23 AM

Review comments addressed.

ELF/Driver.cpp
195–197 ↗(On Diff #37770)

Done.

test/elf2/linkerscript.s
9–11 ↗(On Diff #37770)

Done.

ruiu accepted this revision.Oct 19 2015, 10:33 AM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 19 2015, 10:33 AM
This revision was automatically updated to reflect the committed changes.