aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2009-04-01 19:27:38 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2009-04-01 19:27:38 +0000
commitb3d1832c347fbfdf0c816aaa8910fc327c929b02 (patch)
treee2057a613b12feccb09da616d9ca896bdf2992c1 /ld
parent865093a3bf093d4667086b0f826b5768f9a49236 (diff)
downloadgdb-b3d1832c347fbfdf0c816aaa8910fc327c929b02.zip
gdb-b3d1832c347fbfdf0c816aaa8910fc327c929b02.tar.gz
gdb-b3d1832c347fbfdf0c816aaa8910fc327c929b02.tar.bz2
bfd/
* xcofflink.c (xcoff_link_create_extra_sections): Don't create a .loader section for relocatable links. (xcoff_need_ldrel_p): New function. (xcoff_mark): Use it. (bfd_xcoff_link_count_reloc): Only count loader relocs if there's a loader section. (xcoff_build_ldsym): New function, split out from... (xcoff_build_ldsyms): ...here. Rename to... (xcoff_post_gc_symbol): ...this. Only export symbols, and only call xcoff_build_ldsym, if there's a loader section. (xcoff_build_loader_section): New function, extracted verbatim from... (bfd_xcoff_size_dynamic_sections): ...here. Only call it if there's a loader section. Only add an __rtinit loader symbol if there's a loader section. Update after above name change. (xcoff_symbol_section, xcoff_create_ldrel): New functions. (bfd_link_input_bfd): Use xcoff_need_ldrel_p, xcoff_symbol_section and xcoff_create_ldrel. (xcoff_write_global_symbol): Use xcoff_create_ldrel. (xcoff_reloc_link_order): Likewise, but only call it if there's a loader section. Use xcoff_symbol_section. (_bfd_xcoff_bfd_final_link): Only use fdinfo.ldrel and fdinfo.ldsym if there's a loader section. ld/testsuite/ * ld-powerpc/aix-rel-1.s, ld-powerpc/aix-rel-1.od: New test. * ld-powerpc/aix52.exp: Run it.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-powerpc/aix-rel-1.od22
-rw-r--r--ld/testsuite/ld-powerpc/aix-rel-1.s5
-rw-r--r--ld/testsuite/ld-powerpc/aix52.exp4
3 files changed, 31 insertions, 0 deletions
diff --git a/ld/testsuite/ld-powerpc/aix-rel-1.od b/ld/testsuite/ld-powerpc/aix-rel-1.od
new file mode 100644
index 0000000..0d9f2bb
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-rel-1.od
@@ -0,0 +1,22 @@
+
+.*
+
+# It doesn't matter whether .text, .bss and .debug are listed, as long as
+# they're empty. The important thing is that .loader shouldn't appear
+# at all.
+Sections:
+ *Idx Name * Size .*
+ *0 \.text * 0+0 .*
+ *ALLOC, LOAD, CODE
+ *1 \.data * 0+8 .*
+ *CONTENTS, ALLOC, LOAD, RELOC, DATA
+ *2 \.bss * 0+0 .*
+ *ALLOC
+ *3 \.debug * 0+0 .*
+
+RELOCATION RECORDS FOR \[\.data\]:
+OFFSET * TYPE * VALUE
+0+0 R_POS(|_32) * \.puts
+0+4 R_POS(|_32) * foobar
+
+
diff --git a/ld/testsuite/ld-powerpc/aix-rel-1.s b/ld/testsuite/ld-powerpc/aix-rel-1.s
new file mode 100644
index 0000000..9891ba8
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/aix-rel-1.s
@@ -0,0 +1,5 @@
+ .globl foo
+ .csect foo[RW]
+foo:
+ .long .puts
+ .long foobar
diff --git a/ld/testsuite/ld-powerpc/aix52.exp b/ld/testsuite/ld-powerpc/aix52.exp
index fb2307a..c88ba9b 100644
--- a/ld/testsuite/ld-powerpc/aix52.exp
+++ b/ld/testsuite/ld-powerpc/aix52.exp
@@ -171,6 +171,10 @@ set aix52tests {
{{objdump -d aix-glink-2-SIZE.dd}}
"aix-glink-2"}
+ {"Relocatable test 1" "-r"
+ "" {aix-rel-1.s}
+ {{objdump -hr aix-rel-1.od}} "aix-rel-1.ro"}
+
{"Weak test 1 (rel)" "-r"
"" {aix-weak-1a.s aix-weak-1b.s}
{{nm {} aix-weak-1-rel.nd} {objdump -h aix-weak-1-rel.hd}}