aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2006-08-18 15:00:18 +0000
committerPaul Brook <paul@codesourcery.com>2006-08-18 15:00:18 +0000
commita4fd1a8ee5a761bb9163bc7e1dacf14313860303 (patch)
tree4e44bf1c12d23e30329ddc7e37b6ee982b641d3c /ld
parent7c9e8d98112842cba7fde29e05ab9860c9098b43 (diff)
downloadgdb-a4fd1a8ee5a761bb9163bc7e1dacf14313860303.zip
gdb-a4fd1a8ee5a761bb9163bc7e1dacf14313860303.tar.gz
gdb-a4fd1a8ee5a761bb9163bc7e1dacf14313860303.tar.bz2
2006-08-18 Paul Brook <paul@codesourcery.com>
bfd/ * elf32-arm.c (elf32_arm_link_hash_entry): Add export_glue. (elf32_arm_link_hash_newfunc): Initialize export_glue. (record_arm_to_thumb_glue): Return stub symbol. (elf32_arm_create_thumb_stub): New function. (elf32_arm_to_thumb_stub): Use it. (elf32_arm_to_thumb_export_stub): New function. (elf32_arm_begin_write_processing): New function. (allocate_dynrelocs): Allocate Arm stubs. (elf_backend_begin_write_processing): Define. (elf32_arm_symbian_begin_write_processing): Remove ATTRIBUTE_UNUSED. Call elf32_arm_begin_write_processing. ld/ * emultempl/armelf.em (arm_elf_before_allocation): Call gld${EMULATION_NAME}_before_allocation after setting interworking bfd. ld/testsuite/ * ld-arm/arm-elf.exp (armelftests): Add armthumb-lib.so. Add -use-blx to mixed-lib.so * ld-arm/armthumb-lib.d: New file. * ld-arm/armthumb-lib.sym: New file.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/armelf.em6
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp6
-rw-r--r--ld/testsuite/ld-arm/armthumb-lib.d44
-rw-r--r--ld/testsuite/ld-arm/armthumb-lib.sym18
6 files changed, 82 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 49e65fc..698f0eb 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-18 Paul Brook <paul@codesourcery.com>
+
+ * emultempl/armelf.em (arm_elf_before_allocation): Call
+ gld${EMULATION_NAME}_before_allocation after setting interworking bfd.
+
2006-08-17 Pedro Alves <pedro_alves@portugalmail.pt>
* pe-dll.c (autofilter_symbolprefixlist): Remove .idata$.
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
index bd74ab5..17fc522 100644
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -103,9 +103,6 @@ arm_elf_before_allocation (void)
{
bfd *tem;
- /* Call the standard elf routine. */
- gld${EMULATION_NAME}_before_allocation ();
-
if (link_info.input_bfds != NULL)
{
/* The interworking bfd must be the last one in the link. */
@@ -126,6 +123,9 @@ arm_elf_before_allocation (void)
}
/* We should be able to set the size of the interworking stub section. */
+ /* Call the standard elf routine. */
+ gld${EMULATION_NAME}_before_allocation ();
+
/* Here we rummage through the found bfds to collect glue information. */
/* FIXME: should this be based on a command line option? krk@cygnus.com */
{
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index ac678c3..eca6c30 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2006-08-18 Paul Brook <paul@codesourcery.com>
+
+ * ld-arm/arm-elf.exp (armelftests): Add armthumb-lib.so. Add
+ -use-blx to mixed-lib.so
+ * ld-arm/armthumb-lib.d: New file.
+ * ld-arm/armthumb-lib.sym: New file.
+
2006-08-18 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3052
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index e8e6a85..eee3204 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -77,7 +77,11 @@ set armelftests {
{"Non-pcrel function reference" "tmpdir/arm-lib.so" "" {arm-app-abs32.s}
{{objdump -fdw arm-app-abs32.d} {objdump -Rw arm-app-abs32.r}}
"arm-app-abs32"}
- {"Mixed ARM/Thumb shared library" "-shared -T arm-lib.ld" ""
+ {"Thumb shared library with ARM entry points" "-shared -T arm-lib.ld" ""
+ {mixed-lib.s}
+ {{objdump -fdw armthumb-lib.d} {readelf -Ds armthumb-lib.sym}}
+ "armthumb-lib.so"}
+ {"Mixed ARM/Thumb shared library" "-shared -T arm-lib.ld -use-blx" ""
{mixed-lib.s}
{{objdump -fdw mixed-lib.d} {objdump -Rw mixed-lib.r}
{readelf -Ds mixed-lib.sym}}
diff --git a/ld/testsuite/ld-arm/armthumb-lib.d b/ld/testsuite/ld-arm/armthumb-lib.d
new file mode 100644
index 0000000..66e0590
--- /dev/null
+++ b/ld/testsuite/ld-arm/armthumb-lib.d
@@ -0,0 +1,44 @@
+
+tmpdir/armthumb-lib.so: file format elf32-(little|big)arm
+architecture: arm, flags 0x00000150:
+HAS_SYMS, DYNAMIC, D_PAGED
+start address 0x.*
+
+Disassembly of section .plt:
+
+.* <.plt>:
+ .*: e52de004 str lr, \[sp, #-4\]!
+ .*: e59fe004 ldr lr, \[pc, #4\] ; .* <\.plt\+0x10>
+ .*: e08fe00e add lr, pc, lr
+ .*: e5bef008 ldr pc, \[lr, #8\]!
+ .*: .*
+ .*: e28fc6.* add ip, pc, #.* ; 0x.*
+ .*: e28cca.* add ip, ip, #.* ; 0x.*
+ .*: e5bcf.* ldr pc, \[ip, #.*\]!
+Disassembly of section .text:
+
+.* <lib_func1>:
+ .*: e1a0c00d mov ip, sp
+ .*: e92dd800 stmdb sp!, {fp, ip, lr, pc}
+ .*: ebfffff. bl .* <.text-0x..>
+ .*: e89d6800 ldmia sp, {fp, sp, lr}
+ .*: e12fff1e bx lr
+ .*: e1a00000 nop \(mov r0,r0\)
+ .*: e1a00000 nop \(mov r0,r0\)
+ .*: e1a00000 nop \(mov r0,r0\)
+
+.* <__real_lib_func2>:
+ .*: 4770 bx lr
+ .*: 46c0 nop \(mov r8, r8\)
+ .*: 46c0 nop \(mov r8, r8\)
+ .*: 46c0 nop \(mov r8, r8\)
+ .*: 46c0 nop \(mov r8, r8\)
+ .*: 46c0 nop \(mov r8, r8\)
+ .*: 46c0 nop \(mov r8, r8\)
+ .*: 46c0 nop \(mov r8, r8\)
+
+.* <lib_func2>:
+ .*: e59fc004 ldr ip, \[pc, #4\] ; 33c <lib_func2\+0xc>
+ .*: e08cc00f add ip, ip, pc
+ .*: e12fff1c bx ip
+ .*: ffffffe5 .*
diff --git a/ld/testsuite/ld-arm/armthumb-lib.sym b/ld/testsuite/ld-arm/armthumb-lib.sym
new file mode 100644
index 0000000..d05794c
--- /dev/null
+++ b/ld/testsuite/ld-arm/armthumb-lib.sym
@@ -0,0 +1,18 @@
+
+Symbol table for image:
+ Num Buc: Value Size Type Bind Vis Ndx Name
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS _edata
+ .. ..: .......0 20 FUNC GLOBAL DEFAULT 6 lib_func1
+ .. ..: .......0 2 FUNC GLOBAL DEFAULT 6 lib_func2
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS _bss_end__
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __bss_end__
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS _stack
+ .. ..: ........ 4 OBJECT GLOBAL DEFAULT 9 data_obj
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __bss_start__
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __bss_start
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS _end
+ .. ..: 00000000 0 NOTYPE GLOBAL DEFAULT UND app_func2
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __exidx_end
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT 9 __data_start
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __end__
+ .. ..: ........ 0 NOTYPE GLOBAL DEFAULT ABS __exidx_start