This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM unwind table linker processing


> This breaks kernel builds on arm-linux-gnueabi.

Argh. We'd already found and fixed this once, but I missed it when merging the 
patch. Fixed as below.

Paul

2009-05-15  Andrew Stubbs  <ams@codesourcery.com>
	Paul Brook  <paul@codesourcery.com>

	bfd/
	* elf32-arm.c (elf32_arm_fix_exidx_coverage): Don't attempt to
	fix discarded sections.

	ld/testsuite/
	* ld-arm/arm-elf.exp: Add unwind-5.
	* ld-arm/discard-unwind.ld: New file.
	* ld-arm/unwind-5.d: New test.
	* ld-arm/unwind-5.s: New test.

Index: ld/testsuite/ld-arm/discard-unwind.ld
===================================================================
--- ld/testsuite/ld-arm/discard-unwind.ld	(revision 0)
+++ ld/testsuite/ld-arm/discard-unwind.ld	(revision 0)
@@ -0,0 +1,19 @@
+/* Script for ld testsuite */
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  PROVIDE (__executable_start = 0x8000); . = 0x8000;
+  .text           :
+  {
+    *(.before)
+    *(.text)
+    *(.after)
+    *(.ARM.extab*)
+    *(.glue_7)
+    *(.v4_bx)
+  } =0
+  /DISCARD/ : { *(.ARM.exidx*) }
+  .ARM.attribues 0 : { *(.ARM.atttributes) }
+}
Index: ld/testsuite/ld-arm/unwind-5.d
===================================================================
--- ld/testsuite/ld-arm/unwind-5.d	(revision 0)
+++ ld/testsuite/ld-arm/unwind-5.d	(revision 0)
@@ -0,0 +1,7 @@
+#ld: -T discard-unwind.ld
+#objdump: -s
+
+.*:     file format.*
+
+# Check we don't crash when discarding unwind info.
+#...
Index: ld/testsuite/ld-arm/unwind-5.s
===================================================================
--- ld/testsuite/ld-arm/unwind-5.s	(revision 0)
+++ ld/testsuite/ld-arm/unwind-5.s	(revision 0)
@@ -0,0 +1,12 @@
+	.syntax unified
+	.text
+	.global __aeabi_unwind_cpp_pr0
+	.type __aeabi_unwind_cpp_pr0, %function
+__aeabi_unwind_cpp_pr0:
+	.global _start
+	.type _start, %function
+_start:
+	.fnstart
+	.save {r4, lr}
+	bx lr
+	.fnend
Index: ld/testsuite/ld-arm/arm-elf.exp
===================================================================
--- ld/testsuite/ld-arm/arm-elf.exp	(revision 249367)
+++ ld/testsuite/ld-arm/arm-elf.exp	(working copy)
@@ -396,3 +396,4 @@ run_dump_test "unwind-1"
 run_dump_test "unwind-2"
 run_dump_test "unwind-3"
 run_dump_test "unwind-4"
+run_dump_test "unwind-5"
Index: bfd/elf32-arm.c
===================================================================
--- bfd/elf32-arm.c	(revision 249367)
+++ bfd/elf32-arm.c	(working copy)
@@ -8352,6 +8352,10 @@ elf32_arm_fix_exidx_coverage (asection *
 	  continue;
 	}
 
+      /* Skip /DISCARD/ sections.  */
+      if (bfd_is_abs_section (exidx_sec->output_section))
+	continue;
+
       hdr = &elf_section_data (exidx_sec)->this_hdr;
       if (hdr->sh_type != SHT_ARM_EXIDX)
         continue;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]