Skip to content

Commit

Permalink
[ELF] Adjust getOutputSectionName prefix order
Browse files Browse the repository at this point in the history
Sorting the prefixes by decreasing frequency can improve performance.
.gcc_except_table is relatively frequent, so move it ahead.
.ctors and .dtors mostly disappear and should be the last.
  • Loading branch information
MaskRay committed Dec 15, 2021
1 parent abbc2e9 commit 3deb82c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lld/ELF/LinkerScript.cpp
Expand Up @@ -101,9 +101,9 @@ static StringRef getOutputSectionName(const InputSectionBase *s) {
return v;

for (StringRef v :
{".text", ".rodata", ".data.rel.ro", ".data", ".bss.rel.ro", ".bss",
".init_array", ".fini_array", ".ctors", ".dtors", ".tbss",
".gcc_except_table", ".tdata", ".ARM.exidx", ".ARM.extab"})
{".text", ".data.rel.ro", ".data", ".rodata", ".bss.rel.ro", ".bss",
".gcc_except_table", ".init_array", ".fini_array", ".tbss", ".tdata",
".ARM.exidx", ".ARM.extab", ".ctors", ".dtors"})
if (isSectionPrefix(v, s->name))
return v;

Expand Down

0 comments on commit 3deb82c

Please sign in to comment.