[PATCH] D23775: [LLD][ARM] Canonicalize output section name for .ARM.exidx sections

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 02:17:07 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL279617: Canonicalize output section name for .ARM.exidx sections (authored by psmith).

Changed prior to commit:
  https://reviews.llvm.org/D23775?vs=68864&id=69089#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23775

Files:
  lld/trunk/ELF/Writer.cpp
  lld/trunk/test/ELF/arm-exidx-output.s

Index: lld/trunk/test/ELF/arm-exidx-output.s
===================================================================
--- lld/trunk/test/ELF/arm-exidx-output.s
+++ lld/trunk/test/ELF/arm-exidx-output.s
@@ -0,0 +1,50 @@
+// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t
+// RUN: ld.lld %t -o %t2 2>&1
+// RUN: llvm-readobj -sections %t2 | FileCheck %s
+// REQUIRES: arm
+
+// Check that only a single .ARM.exidx output section is created when
+// there are input sections of the form .ARM.exidx.<section-name>. The
+// assembler creates the .ARM.exidx input sections with the .cantunwind
+// directive
+ .syntax unified
+ .section .text, "ax",%progbits
+ .globl _start
+ .align 2
+ .type _start,%function
+_start:
+ .fnstart
+ bx lr
+ .cantunwind
+ .fnend
+
+ .section .text.f1, "ax", %progbits
+ .globl f1
+ .align 2
+ .type f1,%function
+f1:
+ .fnstart
+ bx lr
+ .cantunwind
+ .fnend
+
+ .section .text.f2, "ax", %progbits
+ .globl f2
+ .align 2
+ .type f2,%function
+f2:
+ .fnstart
+ bx lr
+ .cantunwind
+ .fnend
+
+// CHECK:         Section {
+// CHECK:         Name: .ARM.exidx
+// CHECK-NEXT:    Type: SHT_ARM_EXIDX (0x70000001)
+// CHECK-NEXT:    Flags [ (0x82)
+// CHECK-NEXT:      SHF_ALLOC (0x2)
+// CHECK-NEXT:      SHF_LINK_ORDER (0x80)
+// CHECK-NEXT:    ]
+
+// CHECK-NOT:     Name: .ARM.exidx.text.f1
+// CHECK-NOT:     Name: .ARM.exidx.text.f2
Index: lld/trunk/ELF/Writer.cpp
===================================================================
--- lld/trunk/ELF/Writer.cpp
+++ lld/trunk/ELF/Writer.cpp
@@ -90,7 +90,7 @@
   StringRef Name = S->getSectionName();
   for (StringRef V : {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.",
                       ".init_array.", ".fini_array.", ".ctors.", ".dtors.",
-                      ".tbss.", ".gcc_except_table.", ".tdata."})
+                      ".tbss.", ".gcc_except_table.", ".tdata.", ".ARM.exidx."})
     if (Name.startswith(V))
       return V.drop_back();
   return Name;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23775.69089.patch
Type: text/x-patch
Size: 1976 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160824/02423790/attachment.bin>


More information about the llvm-commits mailing list