old-cross-binutils/ld/testsuite/ld-powerpc/aix-glink-2-32.dd
Richard Sandiford 8602d4fea6 include/coff/
* internal.h (C_AIX_WEAKEXT): New macro.
	(C_WEAKEXT): Use the GNU definition in the generic part of the file,
	and conditionally reset it to C_AIX_WEAKEXT in the XCOFF part of
	the file.
	(CSECT_SYM_P): New macro.
	* xcoff.h (L_WEAK): Define.
	(EXTERN_SYM_P): New macro.

bfd/
	* coffcode.h (coff_pointerize_aux_hook): Update CSECT_SYM_P to
	check whether a symbol has csect information.
	(coff_print_aux): Likewise.
	* coff-rs6000.c (_bfd_xcoff_swap_aux_in): Handle auxillary csect
	information for C_AIX_WEAKEXT too.
	(_bfd_xcoff_swap_aux_out): Likewise.
	(xcoff_reloc_type_br): Handle defweak symbols too.
	* coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Handle auxillary csect
	information for C_AIX_WEAKEXT too.
	(_bfd_xcoff64_swap_aux_out): Likewise.
	(xcoff64_reloc_type_br): Handle defweak symbols too.
	* coffgen.c (coff_print_symbol): Handle auxillary function
	information for C_AIX_WEAKEXT too.
	* xcofflink.c (_bfd_xcoff_canonicalize_dynamic_symtab): Set BSF_WEAK
	instead of BSF_GLOBAL if the L_WEAK flag is set.
	(xcoff_dynamic_definition_p): New function.
	(xcoff_link_add_dynamic_symbols): Use it to decide whether ldsym
	defines h.  Don't change h if ldsym isn't the definition.  Otherwise,
	always take the symbol class from the ldsym.  Use weak bfd symbol
	types for weak ldsyms.
	(xcoff_link_add_symbols): Use CSECT_SYM_P and EXTERN_SYM_P.
	Fix the check for whether a definition is from a shared object.
	Allow redefinitions of weak symbols.
	(xcoff_link_check_ar_symbols): Use EXTERN_SYM_P.
	(xcoff_keep_symbol_p): Likewise.
	(bfd_xcoff_size_dynamic_sections): Use CSECT_SYM_P.
	(xcoff_link_input_bfd): Use CSECT_SYM_P and EXTERN_SYM_P.
	Add .loader entries for C_AIX_WEAKEXT as well as C_EXT symbols,
	but mark them as L_WEAK.
	(xcoff_write_global_symbol): Treat weak symbols as C_AIX_WEAKEXT
	instead of C_EXT if C_AIX_WEAKEXT == C_WEAKEXT.

gas/
	* config/tc-ppc.c (ppc_frob_symbol): Add csect information for
	C_AIX_WEAKEXT too.

ld/testsuite/
	* ld-powerpc/aix-glink-2a.s, ld-powerpc/aix-glink-2a.ex,
	ld-powerpc/aix-glink-2b.s, ld-powerpc/aix-glink-2c.s,
	ld-powerpc/aix-glink-2c.ex, ld-powerpc/aix-glink-2d.s,
	ld-powerpc/aix-glink-2-32.dd, ld-powerpc/aix-glink-2-64.dd,
	ld-powerpc/aix-weak-1a.s, ld-powerpc/aix-weak-1b.s,
	ld-powerpc/aix-weak-1-rel.hd, ld-powerpc/aix-weak-1-rel.nd,
	ld-powerpc/aix-weak-1-dso.hd, ld-powerpc/aix-weak-1-dso.nd,
	ld-powerpc/aix-weak-1-dso.dnd, ld-powerpc/aix-weak-1.ex,
	ld-powerpc/aix-weak-2a.s, ld-powerpc/aix-weak-2a.ex,
	ld-powerpc/aix-weak-2a.nd, ld-powerpc/aix-weak-2b.s,
	ld-powerpc/aix-weak-2b.nd, ld-powerpc/aix-weak-2c.s,
	ld-powerpc/aix-weak-2c.ex, ld-powerpc/aix-weak-2c.nd,
	ld-powerpc/aix-weak-2c.od, ld-powerpc/aix-weak-3a.s,
	ld-powerpc/aix-weak-3a.ex, ld-powerpc/aix-weak-3b.s,
	ld-powerpc/aix-weak-3b.ex, ld-powerpc/aix-weak-3-32.d,
	ld-powerpc/aix-weak-3-32.dd, ld-powerpc/aix-weak-3-64.d,
	ld-powerpc/aix-weak-3-64.dd: New tests.
	* ld-powerpc/aix52.exp: Run them.  Replace tmp/aix-* with
	tmp/aix64-* in 64-bit ld options.
2009-03-14 09:34:27 +00:00

69 lines
2.1 KiB
Text

tmpdir/aix-glink-2: file format aixcoff-rs6000
Disassembly of section \.text:
10000000 <\.b1>:
10000000: 60 00 00 00 oril r0,r0,0
10000004 <\.b2>:
10000004: 60 00 00 00 oril r0,r0,0
10000008 <\.b3>:
10000008: 60 00 00 00 oril r0,r0,0
1000000c <\.main>:
1000000c: 48 00 f1 03 bla f100 <.*>
10000010: 48 00 00 21 bl 10000030 <\.a2>
10000014: 48 00 00 41 bl 10000054 <\.a3>
10000018: 4b ff ff e9 bl 10000000 <\.b1>
1000001c: 4b ff ff e9 bl 10000004 <\.b2>
10000020: 4b ff ff e9 bl 10000008 <\.b3>
10000024: 48 00 f5 03 bla f500 <.*>
10000028: 48 00 00 51 bl 10000078 <\.c2>
1000002c: 48 00 00 71 bl 1000009c <\.c3>
10000030 <\.a2>:
10000030: 81 82 00 00 l r12,0\(r2\)
10000034: 90 41 00 14 st r2,20\(r1\)
10000038: 80 0c 00 00 l r0,0\(r12\)
1000003c: 80 4c 00 04 l r2,4\(r12\)
10000040: 7c 09 03 a6 mtctr r0
10000044: 4e 80 04 20 bctr
10000048: 00 00 00 00 \.long 0x0
1000004c: 00 0c 80 00 \.long 0xc8000
10000050: 00 00 00 00 \.long 0x0
10000054 <\.a3>:
10000054: 81 82 00 04 l r12,4\(r2\)
10000058: 90 41 00 14 st r2,20\(r1\)
1000005c: 80 0c 00 00 l r0,0\(r12\)
10000060: 80 4c 00 04 l r2,4\(r12\)
10000064: 7c 09 03 a6 mtctr r0
10000068: 4e 80 04 20 bctr
1000006c: 00 00 00 00 \.long 0x0
10000070: 00 0c 80 00 \.long 0xc8000
10000074: 00 00 00 00 \.long 0x0
10000078 <\.c2>:
10000078: 81 82 00 08 l r12,8\(r2\)
1000007c: 90 41 00 14 st r2,20\(r1\)
10000080: 80 0c 00 00 l r0,0\(r12\)
10000084: 80 4c 00 04 l r2,4\(r12\)
10000088: 7c 09 03 a6 mtctr r0
1000008c: 4e 80 04 20 bctr
10000090: 00 00 00 00 \.long 0x0
10000094: 00 0c 80 00 \.long 0xc8000
10000098: 00 00 00 00 \.long 0x0
1000009c <\.c3>:
1000009c: 81 82 00 0c l r12,12\(r2\)
100000a0: 90 41 00 14 st r2,20\(r1\)
100000a4: 80 0c 00 00 l r0,0\(r12\)
100000a8: 80 4c 00 04 l r2,4\(r12\)
100000ac: 7c 09 03 a6 mtctr r0
100000b0: 4e 80 04 20 bctr
100000b4: 00 00 00 00 \.long 0x0
100000b8: 00 0c 80 00 \.long 0xc8000
100000bc: 00 00 00 00 \.long 0x0