This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Do not call doInitSymbols for all ELFTs
ClosedPublic

Authored by grimar on Mar 10 2016, 8:46 AM.

Details

Summary

It looks a bit wierd that we have to initialize symbols for all ELFT types when
we use only one ELFT for link. It is little but extra work. Do we really have reasons for that ?
I reviewed this symbols we are initializing and I think we can only init those
what we need at start of link() call.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 50283.Mar 10 2016, 8:46 AM
grimar retitled this revision from to [ELF] - Do not call doInitSymbols for all ELFTs.
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
rafael accepted this revision.Mar 10 2016, 8:50 AM
rafael edited edge metadata.

LGTM. As a followup patch, can you move doInitSymbols to Driver.cpp and make it static?

This revision is now accepted and ready to land.Mar 10 2016, 8:50 AM

LGTM. As a followup patch, can you move doInitSymbols to Driver.cpp and make it static?

Sure. Should this change also be reviewed or can I just commit it after this one ?

LGTM. As a followup patch, can you move doInitSymbols to Driver.cpp and make it static?

Sure. Should this change also be reviewed or can I just commit it after this one ?

I mean "followup" here is the same commit or separate one ?

ruiu accepted this revision.Mar 10 2016, 9:25 AM
ruiu edited edge metadata.

LGTM

ELF/Symbols.h
44 ↗(On Diff #50283)

Rename doInitSymbols -> initSymbols. ("do" is a prefix I often add to file-local helper functions.)

This revision was automatically updated to reflect the committed changes.

As a followup patch, can you move doInitSymbols to Driver.cpp and make it static?

Will do that tomorrow as well.

ruiu added a comment.Mar 14 2016, 10:39 AM

Because that Symbol.cpp needs to initialize symbols for each ELF type is an internal detail of the file. initSymbol, or in general, init<filename> is the initializer function for a file.