bfd/
authorDaniel Jacobowitz <drow@false.org>
Wed, 9 Dec 2009 21:42:00 +0000 (21:42 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 9 Dec 2009 21:42:00 +0000 (21:42 +0000)
* elf32-arm.c (elf32_arm_next_input_section): Skip sections without
SEC_CODE.

ld/testsuite/
* ld-arm/arm-elf.exp (armeabitests): Add farcall-data.
* ld-arm/farcall-data.d, ld-arm/farcall-data.s: New.
* lib/ld-lib.exp (run_ld_link_tests, run_cc_link_tests): Correct
regular expression for archives.

bfd/ChangeLog
bfd/elf32-arm.c
ld/testsuite/ChangeLog
ld/testsuite/ld-arm/arm-elf.exp
ld/testsuite/ld-arm/farcall-data.d [new file with mode: 0644]
ld/testsuite/ld-arm/farcall-data.s [new file with mode: 0644]
ld/testsuite/lib/ld-lib.exp

index 6cbee4ac7b397ac0d40ac19d7c0f68ef478a94be..25912604288d8f606d4d3dde0793562cd7f7915d 100644 (file)
@@ -1,3 +1,8 @@
+2009-12-09  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * elf32-arm.c (elf32_arm_next_input_section): Skip sections without
+       SEC_CODE.
+
 2009-12-08  Alan Modra  <amodra@bigpond.net.au>
 
        * elf.c (write_zeros): New function.
index 21f92a4235a6e5ca1bf8b6ff57fedc7a7b097f40..2168fc04f4717888a958cbeb1371912c3ee9d1ec 100644 (file)
@@ -3785,7 +3785,7 @@ elf32_arm_next_input_section (struct bfd_link_info *info,
     {
       asection **list = htab->input_list + isec->output_section->index;
 
-      if (*list != bfd_abs_section_ptr)
+      if (*list != bfd_abs_section_ptr && (isec->flags & SEC_CODE) != 0)
        {
          /* Steal the link_sec pointer for our list.  */
 #define PREV_SEC(sec) (htab->stub_group[(sec)->id].link_sec)
index 537c2d6e8ea33f20abb2cace251d15dd35869094..1bd1edadae604b0ba9e4771a1dc8eae6ce7edc46 100644 (file)
@@ -1,3 +1,10 @@
+2009-12-09  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * ld-arm/arm-elf.exp (armeabitests): Add farcall-data.
+       * ld-arm/farcall-data.d, ld-arm/farcall-data.s: New.
+       * lib/ld-lib.exp (run_ld_link_tests, run_cc_link_tests): Correct
+       regular expression for archives.
+
 2009-11-23  Paul Brook  <paul@codesourcery.com>
 
        * ld-arm/script-type.sym: New test.
index 8fbf8df29f9e8122cf562d3ecfcbc067367c74c0..23728449e208d85a1754bd6176cfddfa1a71d0f3 100644 (file)
@@ -422,6 +422,9 @@ set armeabitests {
      {{objdump -fdw farcall-mixed-lib.d}}
      "farcall-mixed-lib.so"}
 
+    {"Long branch with mixed text and data" "-T arm.ld" "" {farcall-data.s}
+     {{objdump -dr farcall-data.d}}
+     "farcall-data"}
 }
 
 run_ld_link_tests $armeabitests
diff --git a/ld/testsuite/ld-arm/farcall-data.d b/ld/testsuite/ld-arm/farcall-data.d
new file mode 100644 (file)
index 0000000..a8b231c
--- /dev/null
@@ -0,0 +1,19 @@
+.*:     file format .*
+
+Disassembly of section .text:
+
+00008000 <_start>:
+    8000:      ea000000        b       8008 <__far_veneer>
+    8004:      00000000        andeq   r0, r0, r0
+
+00008008 <__far_veneer>:
+    8008:      e51ff004        ldr     pc, \[pc, #-4\] ; 800c <__far_veneer\+0x4>
+    800c:      12340000        \.word  0x12340000
+
+00008010 <after>:
+    8010:      11111111        \.word  0x11111111
+
+Disassembly of section \.far:
+
+12340000 <far>:
+12340000:      e12fff1e        bx      lr
diff --git a/ld/testsuite/ld-arm/farcall-data.s b/ld/testsuite/ld-arm/farcall-data.s
new file mode 100644 (file)
index 0000000..ed66199
--- /dev/null
@@ -0,0 +1,14 @@
+       .syntax unified
+       .text
+       .global _start
+       .type _start, %function
+_start:
+    b far
+
+.section .after
+after:
+       .word 0x11111111
+
+       .section .far, "ax"
+       .type far, %function
+far:   bx lr
index a738747d9109c4fb966ed3ae91ff1627dca18d04..65a5ffb116a351630fb5493f84d865ce89500ab4 100644 (file)
@@ -1227,7 +1227,7 @@ proc run_ld_link_tests { ldtests } {
            continue
        }
 
-       if { [regexp ".*a$" $binfile] } {
+       if { [regexp ".*\\.a$" $binfile] } {
            if { ![ar_simple_create $ar $ld_options $binfile "$objfiles"] } {
                fail $testname
                set failed 1
@@ -1538,7 +1538,7 @@ proc run_cc_link_tests { ldtests } {
            set cc_cmd $CC
        }
 
-       if { [regexp ".*a$" $binfile] } {
+       if { [regexp ".*\\.a$" $binfile] } {
            if { ![ar_simple_create $ar $ldflags $binfile "$objfiles"] } {
                fail $testname
                set failed 1