[PATCH] D85785: [ELF] -r: allow SHT_X86_64_UNWIND to be merged into SHT_PROGBITS
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 13 08:17:05 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG88498f44dfe7: [ELF] -r: allow SHT_X86_64_UNWIND to be merged into SHT_PROGBITS (authored by MaskRay).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85785/new/
https://reviews.llvm.org/D85785
Files:
lld/ELF/OutputSections.cpp
lld/test/ELF/eh-frame-type.test
Index: lld/test/ELF/eh-frame-type.test
===================================================================
--- lld/test/ELF/eh-frame-type.test
+++ lld/test/ELF/eh-frame-type.test
@@ -11,6 +11,9 @@
# RUN: ld.lld %t1.o %t2.o -o %tboth
# RUN: llvm-readobj -S %tboth | FileCheck %s
+# RUN: ld.lld -r %t1.o %t2.o -o %tboth.ro
+# RUN: llvm-readobj -S %tboth.ro | FileCheck %s
+
# CHECK: Name: .eh_frame
# CHECK-NEXT: Type: SHT_PROGBITS
Index: lld/ELF/OutputSections.cpp
===================================================================
--- lld/ELF/OutputSections.cpp
+++ lld/ELF/OutputSections.cpp
@@ -78,10 +78,14 @@
// to be allocated for nobits sections. Other ones don't require
// any special treatment on top of progbits, so there doesn't
// seem to be a harm in merging them.
+//
+// NOTE: clang since rL252300 emits SHT_X86_64_UNWIND .eh_frame sections. Allow
+// them to be merged into SHT_PROGBITS .eh_frame (GNU as .cfi_*).
static bool canMergeToProgbits(unsigned type) {
return type == SHT_NOBITS || type == SHT_PROGBITS || type == SHT_INIT_ARRAY ||
type == SHT_PREINIT_ARRAY || type == SHT_FINI_ARRAY ||
- type == SHT_NOTE;
+ type == SHT_NOTE ||
+ (type == SHT_X86_64_UNWIND && config->emachine == EM_X86_64);
}
// Record that isec will be placed in the OutputSection. isec does not become
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85785.285379.patch
Type: text/x-patch
Size: 1357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200813/875f0f45/attachment-0001.bin>
More information about the llvm-commits
mailing list