From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Marty Leisner" To: bfd@cygnus.com Subject: problem with ppc-aix on gas-980118 Date: Mon, 19 Jan 1998 13:30:00 -0000 Message-id: <9801192128.AA26215@gnu.sdsp.mc.xerox.com> X-SW-Source: 1998/msg00001.html (please also respond to me since I can't seem to get on this list). I want to link a ppc-aix file to an absolute address (against a running program) Here's the program: int foobar(void) { extern int a; return a; } a is an symbol in the program... Here's the command line: ld -o lcm.so -e foobar -Ttext 0x20000a88 -Tdata 0x20000ad0 -Tbss 0x20000af0 -N b.o symbols Here's the symbols file: (gdb) shell cat symbols a = 0x20000a70; printf_indirect = 0x20000908; For information, here's the output of objdump -x: 1 :leisner@gnu; objdump -x b.o b.o: file format aixcoff-rs6000 b.o architecture: rs6000:6000, flags 0x00000031: HAS_RELOC, HAS_SYMS, HAS_LOCALS start address 0x00000000 Sections: Idx Name Size VMA LMA File off Algn 0 .text 00000040 00000000 00000000 000000a8 2**3 CONTENTS, ALLOC, LOAD, RELOC, CODE 1 .data 00000018 00000040 00000040 000000e8 2**3 CONTENTS, ALLOC, LOAD, RELOC, DATA 2 .bss 00000000 00000058 00000058 00000000 2**3 ALLOC In this part of xcofflink.c, its preducing an error: /usr/marty/binutils-debug/bin/ld: b.o: loader reloc in unrecognized section `*ABS*' 96 case R_POS: 5497 case R_NEG: 5498 case R_RL: 5499 case R_RLA: 5500 /* This reloc needs to be copied into the .loader 5501 section. */ 5502 ldrel.l_vaddr = irel->r_vaddr; 5503 if (r_symndx == -1) 5504 ldrel.l_symndx = -1; 5505 else if (h == NULL 5506 || (h->root.type == bfd_link_hash_defined 5507 || h->root.type == bfd_link_hash_defweak 5508 || h->root.type == bfd_link_hash_common)) 5509 { 5510 asection *sec; 5511 5512 if (h == NULL) 5513 sec = xcoff_data (input_bfd)->csects[r_symndx]; 5514 else if (h->root.type == bfd_link_hash_common) 5515 sec = h->root.u.c.p->section; 5516 else 5517 sec = h->root.u.def.section; 5518 sec = sec->output_section; 5519 5520 if (strcmp (sec->name, ".text") == 0) 5521 ldrel.l_symndx = 0; 5522 else if (strcmp (sec->name, ".data") == 0) 5523 ldrel.l_symndx = 1; 5524 else if (strcmp (sec->name, ".bss") == 0) 5525 ldrel.l_symndx = 2; 5526 else 5527 { 5528 (*_bfd_error_handler) 5529 ("%s: loader reloc in unrecognized section `%s'", 5530 bfd_get_filename (input_bfd), 5531 sec->name); 5532 bfd_set_error (bfd_error_nonrepresentable_section); 5533 return false; 5534 } At line 5518, sec == sec->output_section and sec->name = "*ABS*", hence the link fails... Ideas? I'm not a bfd/xcoff expert yet... marty leisner@sdsp.mc.xerox.com Don't confuse education with schooling. Milton Friedman to Yogi Berra