[lld] r270443 - Do not propagate section name and attributes to .eh_frame.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon May 23 08:12:41 PDT 2016
Author: ruiu
Date: Mon May 23 10:12:41 2016
New Revision: 270443
URL: http://llvm.org/viewvc/llvm-project?rev=270443&view=rev
Log:
Do not propagate section name and attributes to .eh_frame.
.eh_frame is always ".eh_frame" and its attribute is fixed.
No need to copy from inputs to outputs. GNU gold also sets
SHT_PROGBITS.
Modified:
lld/trunk/ELF/OutputSections.cpp
lld/trunk/ELF/OutputSections.h
lld/trunk/ELF/Writer.cpp
lld/trunk/test/ELF/eh-frame-hdr.s
lld/trunk/test/ELF/eh-frame-merge.s
lld/trunk/test/ELF/eh-frame-type.test
lld/trunk/test/ELF/ehframe-relocation.s
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=270443&r1=270442&r2=270443&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Mon May 23 10:12:41 2016
@@ -921,9 +921,8 @@ template <class ELFT> void OutputSection
}
template <class ELFT>
-EhOutputSection<ELFT>::EhOutputSection(StringRef Name, uint32_t Type,
- uintX_t Flags)
- : OutputSectionBase<ELFT>(Name, Type, Flags) {
+EhOutputSection<ELFT>::EhOutputSection()
+ : OutputSectionBase<ELFT>(".eh_frame", SHT_PROGBITS, SHF_ALLOC) {
Out<ELFT>::EhFrameHdr->add(this);
}
Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=270443&r1=270442&r2=270443&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Mon May 23 10:12:41 2016
@@ -334,12 +334,13 @@ struct CieRecord {
// Output section for .eh_frame.
template <class ELFT>
class EhOutputSection final : public OutputSectionBase<ELFT> {
-public:
typedef typename ELFT::uint uintX_t;
typedef typename ELFT::Shdr Elf_Shdr;
typedef typename ELFT::Rel Elf_Rel;
typedef typename ELFT::Rela Elf_Rela;
- EhOutputSection(StringRef Name, uint32_t Type, uintX_t Flags);
+
+public:
+ EhOutputSection();
void writeTo(uint8_t *Buf) override;
void finalize() override;
void
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=270443&r1=270442&r2=270443&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Mon May 23 10:12:41 2016
@@ -1174,7 +1174,7 @@ OutputSectionFactory<ELFT>::create(Input
Sec = new OutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
break;
case InputSectionBase<ELFT>::EHFrame:
- Sec = new EhOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags);
+ Sec = new EhOutputSection<ELFT>;
break;
case InputSectionBase<ELFT>::Merge:
Sec = new MergeOutputSection<ELFT>(Key.Name, Key.Type, Key.Flags,
Modified: lld/trunk/test/ELF/eh-frame-hdr.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-hdr.s?rev=270443&r1=270442&r2=270443&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-hdr.s (original)
+++ lld/trunk/test/ELF/eh-frame-hdr.s Mon May 23 10:12:41 2016
@@ -44,7 +44,7 @@ _start:
// HDR: Section {
// HDR: Index: 1
// HDR-NEXT: Name: .eh_frame
-// HDR-NEXT: Type: SHT_X86_64_UNWIND
+// HDR-NEXT: Type: SHT_PROGBITS
// HDR-NEXT: Flags [
// HDR-NEXT: SHF_ALLOC
// HDR-NEXT: ]
Modified: lld/trunk/test/ELF/eh-frame-merge.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-merge.s?rev=270443&r1=270442&r2=270443&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-merge.s (original)
+++ lld/trunk/test/ELF/eh-frame-merge.s Mon May 23 10:12:41 2016
@@ -21,7 +21,7 @@
// * There is only one copy of the second FDE
// CHECK: Name: .eh_frame
-// CHECK-NEXT: Type: SHT_X86_64_UNWIND
+// CHECK-NEXT: Type: SHT_PROGBITS
// CHECK-NEXT: Flags [
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: ]
Modified: lld/trunk/test/ELF/eh-frame-type.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-type.test?rev=270443&r1=270442&r2=270443&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-type.test (original)
+++ lld/trunk/test/ELF/eh-frame-type.test Mon May 23 10:12:41 2016
@@ -3,7 +3,7 @@
# RUN: llvm-readobj -s %t | FileCheck %s
# CHECK: Name: .eh_frame
-# CHECK-NEXT: Type: SHT_X86_64_UNWIND
+# CHECK-NEXT: Type: SHT_PROGBITS
FileHeader:
Class: ELFCLASS64
Modified: lld/trunk/test/ELF/ehframe-relocation.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/ehframe-relocation.s?rev=270443&r1=270442&r2=270443&view=diff
==============================================================================
--- lld/trunk/test/ELF/ehframe-relocation.s (original)
+++ lld/trunk/test/ELF/ehframe-relocation.s Mon May 23 10:12:41 2016
@@ -6,7 +6,7 @@
// RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s
// CHECK: Name: .eh_frame
-// CHECK-NEXT: Type: SHT_X86_64_UNWIND
+// CHECK-NEXT: Type: SHT_PROGBITS
// CHECK-NEXT: Flags [
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: ]
More information about the llvm-commits
mailing list