This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Fix "--symbol-ordering-file doesn't work with linker scripts"
ClosedPublic

Authored by grimar on Jul 25 2017, 8:59 AM.

Details

Summary

This is PR33889,

Patch adds support of combination of linkerscript and
-symbol-ordering-file option.

If no sorting commands are present in script inside section declaration
and no --sort-section option specified, code uses sorting from ordering
file if any exist.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Jul 25 2017, 8:59 AM
grimar updated this revision to Diff 108097.Jul 25 2017, 9:03 AM
  • Cosmetic changes.
ruiu added inline comments.Jul 25 2017, 11:22 AM
ELF/Config.h
80 ↗(On Diff #108097)

SectionsOrder -> SectionOrder

I don't think it is a good idea to make this available everywhere. Please just keep SymbolOrderingFile like before. When you need SectionOrder, compute it and store it to a local variable.

ELF/LinkerScript.cpp
303 ↗(On Diff #108097)

SymbolsOrder -> SymbolOrder

grimar updated this revision to Diff 109332.Aug 2 2017, 6:25 AM
  • Addressed review comments.
ruiu accepted this revision.Aug 4 2017, 2:36 AM

This can be simplified, but I'll do that later. Please submit. LGTM

This revision is now accepted and ready to land.Aug 4 2017, 2:36 AM
This revision was automatically updated to reflect the committed changes.