diff options
| author | Fangrui Song <i@maskray.me> | 2021-12-15 00:18:58 -0800 |
|---|---|---|
| committer | Fangrui Song <i@maskray.me> | 2021-12-15 00:18:58 -0800 |
| commit | 3deb82cd072bd4bb6172ece5e6d01ea6600dc3a8 (patch) | |
| tree | 37411cef86edc911460f921655040675e8dbd541 /lld/ELF/LinkerScript.cpp | |
| parent | abbc2e997bbf8f60ccb18f04c477c28f3ad0a7a2 (diff) | |
| download | llvm-3deb82cd072bd4bb6172ece5e6d01ea6600dc3a8.zip llvm-3deb82cd072bd4bb6172ece5e6d01ea6600dc3a8.tar.gz llvm-3deb82cd072bd4bb6172ece5e6d01ea6600dc3a8.tar.bz2 | |
[ELF] Adjust getOutputSectionName prefix order
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.
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 3a72284..e8aad25 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -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; |
