diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2009-03-14 09:35:46 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2009-03-14 09:35:46 +0000 |
commit | b64232cca5353c35c503dfe096afec18ac3c90f3 (patch) | |
tree | 464ed21110f7c0f37c3e7e044bb27dd96eb5c050 /ld/testsuite/ld-powerpc | |
parent | 7d504122ef2032b3e0d6973a4f4f138481c4b5c2 (diff) | |
download | gdb-b64232cca5353c35c503dfe096afec18ac3c90f3.zip gdb-b64232cca5353c35c503dfe096afec18ac3c90f3.tar.gz gdb-b64232cca5353c35c503dfe096afec18ac3c90f3.tar.bz2 |
include/coff/
* xcoff.h (XCOFF_EXPALL, XCOFF_EXPFULL): New flags.
(xcoff_loader_info): Add auto_export_flags.
bfd/
* bfd-in.h (bfd_xcoff_size_dynamic_sections): Replace the
bfd_boolean export_defineds parameter with an unsigned int
auto_export_flags parameter.
* bfd-in2.h: Regenerate.
* xcofflink.c (xcoff_archive_contains_shared_object_p): New function,
split out from xcoff_build_ldsyms.
(xcoff_covered_by_expall_p): New function.
(xcoff_auto_export_p): New function, split out from xcoff_build_ldsyms
but with extra code to handle -bexpfull and -bexpall.
(xcoff_mark_auto_exports): New function.
(xcoff_build_ldsyms): Use xcoff_auto_export_p to decide whether
a function should be automatically exported.
(bfd_xcoff_size_dynamic_sections): Replace the export_defineds
parameter with an auto_export_flags parameter. Update ldinfo
accordingly. Use xcoff_mark_auto_exports to mark all automatically-
exported symbols.
ld/
* emultempl/aix.em (auto_export_flags): New variable.
(explicit_auto_export_flags): Likewise.
(OPTION_EXPALL, OPTION_EXPFULL): New enum values.
(OPTION_NOEXPALL, OPTION_NOEXPFULL): Likewise.
(gld${EMULATION_NAME}_add_options): Add -bexpall, -bexpfull,
-bnoexpall and -bnoexpfull.
(gld${EMULATION_NAME}_handle_option): Handle them.
(gld${EMULATION_NAME}_before_allocation): Update the call to
bfd_size_dynamic_sections.
ld/testsuite/
* ld-powerpc/aix-export-1-all.dd, ld-powerpc/aix-export-1-full.dd,
ld-powerpc/aix-export-1a.s, ld-powerpc/aix-export-1b.s: New tests.
* ld-powerpc/aix52.exp: Run them.
Diffstat (limited to 'ld/testsuite/ld-powerpc')
-rw-r--r-- | ld/testsuite/ld-powerpc/aix-export-1-all.dd | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/aix-export-1-full.dd | 21 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/aix-export-1a.s | 14 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/aix-export-1b.s | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/aix52.exp | 20 |
5 files changed, 75 insertions, 0 deletions
diff --git a/ld/testsuite/ld-powerpc/aix-export-1-all.dd b/ld/testsuite/ld-powerpc/aix-export-1-all.dd new file mode 100644 index 0000000..90eec95 --- /dev/null +++ b/ld/testsuite/ld-powerpc/aix-export-1-all.dd @@ -0,0 +1,11 @@ + +.* + + +Disassembly of section \.data: + +0*10000000 <main1>: + *10000000: 10 00 00 04 .* + +0*10000004 <lib1>: + *10000004: 11 11 00 01 .* diff --git a/ld/testsuite/ld-powerpc/aix-export-1-full.dd b/ld/testsuite/ld-powerpc/aix-export-1-full.dd new file mode 100644 index 0000000..d300fa2 --- /dev/null +++ b/ld/testsuite/ld-powerpc/aix-export-1-full.dd @@ -0,0 +1,21 @@ + +.* + + +Disassembly of section .data: + +0*10000000 <main1>: + *10000000: 10 00 00 08 .* + +0*10000004 <_main2>: + *10000004: 10 00 00 0c .* + +0*10000008 <lib1>: + *10000008: 11 11 00 01 .* + +0*1000000c <_lib2>: + *1000000c: 11 11 00 02 .* + +0*10000010 <lib3>: + *10000010: 11 11 00 03 .* + *10000014: 00 00 00 00 .* diff --git a/ld/testsuite/ld-powerpc/aix-export-1a.s b/ld/testsuite/ld-powerpc/aix-export-1a.s new file mode 100644 index 0000000..69701e5 --- /dev/null +++ b/ld/testsuite/ld-powerpc/aix-export-1a.s @@ -0,0 +1,14 @@ + .globl lib1 + .csect lib1[RW] +lib1: + .long 0x11110001 + + .globl _lib2 + .csect _lib2[RW] +_lib2: + .long 0x11110002 + + .globl lib3 + .csect lib3[RW] +lib3: + .long 0x11110003 diff --git a/ld/testsuite/ld-powerpc/aix-export-1b.s b/ld/testsuite/ld-powerpc/aix-export-1b.s new file mode 100644 index 0000000..32c355d --- /dev/null +++ b/ld/testsuite/ld-powerpc/aix-export-1b.s @@ -0,0 +1,9 @@ + .globl main1 + .csect main1[RW] +main1: + .long lib1 + + .globl _main2 + .csect _main2[RW] +_main2: + .long _lib2 diff --git a/ld/testsuite/ld-powerpc/aix52.exp b/ld/testsuite/ld-powerpc/aix52.exp index 330de27..fb2307a 100644 --- a/ld/testsuite/ld-powerpc/aix52.exp +++ b/ld/testsuite/ld-powerpc/aix52.exp @@ -108,6 +108,26 @@ set aix52tests { {nm -D aix-no-dup-syms-1-dso.dnd} {objdump -R aix-no-dup-syms-1-dso.drd}} "aix-no-dup-syms-1.so"} + {"Export test 1 (archive)" "" + "" {aix-export-1a.s} + {} "libaix-export-1.a"} + + {"Export test 1 (object)" "-r" + "" {aix-export-1b.s} + {} "aix-export-1.o"} + + {"Export test 1 (-bexpall)" + "-shared -bexpall tmpdir/aix-export-1.o -Ltmpdir -laix-export-1" + "" {} + {{objdump -dj.data aix-export-1-all.dd}} + "aix-export-1-all.so"} + + {"Export test 1 (-bexpfull)" + "-shared -bexpfull tmpdir/aix-export-1.o -Ltmpdir -laix-export-1" + "" {} + {{objdump -dj.data aix-export-1-full.dd}} + "aix-export-1-full.so"} + {"Garbage collection test 1" "-shared -binitfini:init_function:fini_function -bE:aix-gc-1.ex" "" {aix-gc-1.s} |