[lld] r331708 - Add a CIE with length 0 unconditionally.
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon May 7 18:19:16 PDT 2018
Author: maskray
Date: Mon May 7 18:19:16 2018
New Revision: 331708
URL: http://llvm.org/viewvc/llvm-project?rev=331708&view=rev
Log:
Add a CIE with length 0 unconditionally.
Summary: This is not technically required, but glibc unwind-dw2-fde.c classify_object_over_fdes expects there is a CIE record length 0 as a terminator.
Reviewers: ruiu, espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D46566
Modified:
lld/trunk/ELF/SyntheticSections.cpp
lld/trunk/test/ELF/eh-frame-hdr-icf-fde.s
lld/trunk/test/ELF/eh-frame-hdr.s
lld/trunk/test/ELF/eh-frame-merge.s
lld/trunk/test/ELF/ehframe-relocation.s
lld/trunk/test/ELF/invalid-fde-rel.s
lld/trunk/test/ELF/linkerscript/eh-frame-hdr.s
lld/trunk/test/ELF/linkerscript/map-file2.test
lld/trunk/test/ELF/linkerscript/synthetic-symbols1.test
lld/trunk/test/ELF/map-file.s
lld/trunk/test/ELF/relocatable-eh-frame.s
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Mon May 7 18:19:16 2018
@@ -497,10 +497,10 @@ void EhFrameSection::finalizeContents()
}
// The LSB standard does not allow a .eh_frame section with zero
- // Call Frame Information records. Therefore add a CIE record length
- // 0 as a terminator if this .eh_frame section is empty.
- if (Off == 0)
- Off = 4;
+ // Call Frame Information records. glibc unwind-dw2-fde.c
+ // classify_object_over_fdes expects there is a CIE record length 0 as a
+ // terminator. Thus we add one unconditionally.
+ Off += 4;
this->Size = Off;
}
Modified: lld/trunk/test/ELF/eh-frame-hdr-icf-fde.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-hdr-icf-fde.s?rev=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-hdr-icf-fde.s (original)
+++ lld/trunk/test/ELF/eh-frame-hdr-icf-fde.s Mon May 7 18:19:16 2018
@@ -52,7 +52,7 @@
# CHECK-NEXT: ]
# CHECK-NEXT: Address: 0x200178
# CHECK-NEXT: Offset: 0x178
-# CHECK-NEXT: Size: 72
+# CHECK-NEXT: Size: 76
# CHECK-NEXT: Link: 0
# CHECK-NEXT: Info: 0
# CHECK-NEXT: AddressAlignment: 8
@@ -62,7 +62,7 @@
# CHECK-NEXT: 0010: 1B0C0708 90010000 14000000 1C000000
# CHECK-NEXT: 0020: 680E0000 01000000 00000000 00000000
# CHECK-NEXT: 0030: 14000000 34000000 520E0000 01000000
-# CHECK-NEXT: 0040: 00000000 00000000
+# CHECK-NEXT: 0040: 00000000 00000000 00000000
# CHECK-NEXT: )
# CHECK-NEXT: }
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=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-hdr.s (original)
+++ lld/trunk/test/ELF/eh-frame-hdr.s Mon May 7 18:19:16 2018
@@ -92,7 +92,7 @@ _start:
// HDR-NEXT: ]
// HDR-NEXT: Address: 0x200180
// HDR-NEXT: Offset: 0x180
-// HDR-NEXT: Size: 96
+// HDR-NEXT: Size: 100
// HDR-NEXT: Link: 0
// HDR-NEXT: Info: 0
// HDR-NEXT: AddressAlignment: 8
@@ -104,6 +104,7 @@ _start:
// HDR-NEXT: 0030: 14000000 34000000 490E0000 01000000
// HDR-NEXT: 0040: 00000000 00000000 14000000 4C000000
// HDR-NEXT: 0050: 320E0000 01000000 00000000 00000000
+// HDR-NEXT: 0060: 00000000
// HDR-NEXT: )
// CIE: 14000000 00000000 017A5200 01781001 1B0C0708 90010000
// FDE(1): 14000000 1C000000 600E0000 01000000 00000000 00000000
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=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-merge.s (original)
+++ lld/trunk/test/ELF/eh-frame-merge.s Mon May 7 18:19:16 2018
@@ -27,7 +27,7 @@
// CHECK-NEXT: ]
// CHECK-NEXT: Address:
// CHECK-NEXT: Offset:
-// CHECK-NEXT: Size: 96
+// CHECK-NEXT: Size: 100
// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
// CHECK-NEXT: AddressAlignment: 8
@@ -39,6 +39,7 @@
// CHECK-NEXT: 0030: 14000000 34000000 D20D0000 02000000 |
// CHECK-NEXT: 0040: 00000000 00000000 14000000 4C000000 |
// CHECK-NEXT: 0050: B90D0000 01000000 00000000 00000000 |
+// CHECK-NEXT: 0060: 00000000
// CHECK-NEXT: )
// CHECK: Name: foo
Modified: lld/trunk/test/ELF/ehframe-relocation.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/ehframe-relocation.s?rev=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/test/ELF/ehframe-relocation.s (original)
+++ lld/trunk/test/ELF/ehframe-relocation.s Mon May 7 18:19:16 2018
@@ -12,7 +12,7 @@
// CHECK-NEXT: ]
// CHECK-NEXT: Address: 0x200120
// CHECK-NEXT: Offset:
-// CHECK-NEXT: Size: 48
+// CHECK-NEXT: Size: 52
// CHECK-NOT: .eh_frame
// 0x200120 = 2097440
Modified: lld/trunk/test/ELF/invalid-fde-rel.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid-fde-rel.s?rev=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/test/ELF/invalid-fde-rel.s (original)
+++ lld/trunk/test/ELF/invalid-fde-rel.s Mon May 7 18:19:16 2018
@@ -33,4 +33,4 @@
.long 0x0
.long 0x0
-// CHECK: 1 .eh_frame 00000018
+// CHECK: 1 .eh_frame 0000001c
Modified: lld/trunk/test/ELF/linkerscript/eh-frame-hdr.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/eh-frame-hdr.s?rev=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/eh-frame-hdr.s (original)
+++ lld/trunk/test/ELF/linkerscript/eh-frame-hdr.s Mon May 7 18:19:16 2018
@@ -4,7 +4,7 @@
# RUN: ld.lld -o %t1 --eh-frame-hdr --script %t.script %t
# RUN: llvm-objdump -s -section=".eh_frame_hdr" %t1 | FileCheck %s
-# CHECK: 011b033b 14000000 01000000 49000000
+# CHECK: 011b033b 14000000 01000000 4d000000
# CHECK-NEXT: 30000000
.global _start
Modified: lld/trunk/test/ELF/linkerscript/map-file2.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/map-file2.test?rev=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/map-file2.test (original)
+++ lld/trunk/test/ELF/linkerscript/map-file2.test Mon May 7 18:19:16 2018
@@ -32,7 +32,7 @@ SECTIONS {
# CHECK-NEXT: 1124 3114 1 4 {{.*}}{{/|\\}}map-file2.test.tmp.o:(.text)
# CHECK-NEXT: 1124 3114 0 1 f(int)
# CHECK-NEXT: 1124 3114 0 1 _start
-# CHECK-NEXT: 1128 3118 30 8 .eh_frame
+# CHECK-NEXT: 1128 3118 34 8 .eh_frame
# CHECK-NEXT: 1128 3118 30 1 {{.*}}{{/|\\}}map-file2.test.tmp.o:(.eh_frame+0x0)
# CHECK-NEXT: 0 0 8 1 .comment
# CHECK-NEXT: 0 0 8 1 <internal>:(.comment)
Modified: lld/trunk/test/ELF/linkerscript/synthetic-symbols1.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/synthetic-symbols1.test?rev=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/synthetic-symbols1.test (original)
+++ lld/trunk/test/ELF/linkerscript/synthetic-symbols1.test Mon May 7 18:19:16 2018
@@ -41,7 +41,7 @@ SECTIONS {
# CHECK: 0000000000000128 .foo 00000000 .hidden _end_sec
# CHECK-NEXT: 0000000000000120 .foo 00000000 _begin_sec
# CHECK-NEXT: 0000000000000128 *ABS* 00000000 _end_sec_abs
-# CHECK-NEXT: 0000000000001048 .text 00000000 _start
+# CHECK-NEXT: 000000000000104c .text 00000000 _start
# CHECK-NEXT: 0000000000000120 .foo 00000000 begin_foo
# CHECK-NEXT: 0000000000000128 .foo 00000000 end_foo
# CHECK-NEXT: 0000000000000008 *ABS* 00000000 size_foo_1
Modified: lld/trunk/test/ELF/map-file.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/map-file.s?rev=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/test/ELF/map-file.s (original)
+++ lld/trunk/test/ELF/map-file.s Mon May 7 18:19:16 2018
@@ -53,7 +53,7 @@ labs = 0x1AB5
// CHECK-NEXT: 2002d0 2002d0 30 8 <internal>:(.rela.dyn)
// CHECK-NEXT: 200300 200300 30 8 .rela.plt
// CHECK-NEXT: 200300 200300 30 8 <internal>:(.rela.plt)
-// CHECK-NEXT: 200330 200330 60 8 .eh_frame
+// CHECK-NEXT: 200330 200330 64 8 .eh_frame
// CHECK-NEXT: 200330 200330 2c 1 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.eh_frame+0x0)
// CHECK-NEXT: 200360 200360 14 1 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.eh_frame+0x2c)
// CHECK-NEXT: 200378 200378 18 1 {{.*}}{{/|\\}}map-file.s.tmp2.o:(.eh_frame+0x18)
Modified: lld/trunk/test/ELF/relocatable-eh-frame.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relocatable-eh-frame.s?rev=331708&r1=331707&r2=331708&view=diff
==============================================================================
--- lld/trunk/test/ELF/relocatable-eh-frame.s (original)
+++ lld/trunk/test/ELF/relocatable-eh-frame.s Mon May 7 18:19:16 2018
@@ -5,7 +5,7 @@
# RUN: ld.lld %t -o %t.so -shared
# RUN: llvm-objdump -h %t.so | FileCheck --check-prefix=DSO %s
-# DSO: .eh_frame 00000030
+# DSO: .eh_frame 00000034
# CHECK: Relocations [
# CHECK-NEXT: Section ({{.*}}) .rela.eh_frame {
More information about the llvm-commits
mailing list