diff options
Diffstat (limited to 'ELF/InputFiles.cpp')
-rw-r--r-- | ELF/InputFiles.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ELF/InputFiles.cpp b/ELF/InputFiles.cpp index a05007ea6..4614e9ca0 100644 --- a/ELF/InputFiles.cpp +++ b/ELF/InputFiles.cpp @@ -308,10 +308,12 @@ elf::ObjectFile<ELFT>::createInputSection(const Elf_Shdr &Sec) { } } - // We dont need special handling of .eh_frame sections if relocatable - // output was choosen. Proccess them as usual input sections. - if (!Config->Relocatable && Name == ".eh_frame") + // The linker merges EH (exception handling) frames and creates a + // .eh_frame_hdr section for runtime. So we handle them with a special + // class. For relocatable outputs, they are just passed through. + if (Name == ".eh_frame" && !Config->Relocatable) return new (EHAlloc.Allocate()) EhInputSection<ELFT>(this, &Sec); + if (shouldMerge<ELFT>(Sec)) return new (MAlloc.Allocate()) MergeInputSection<ELFT>(this, &Sec); return new (IAlloc.Allocate()) InputSection<ELFT>(this, &Sec); |