public inbox for bfd@sourceware.org
 help / color / mirror / Atom feed
* problem with ppc-aix on gas-980118
@ 1998-01-19 13:30 Marty Leisner
  1998-01-21 18:50 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Marty Leisner @ 1998-01-19 13:30 UTC (permalink / raw)
  To: bfd

(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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: problem with ppc-aix on gas-980118
  1998-01-19 13:30 problem with ppc-aix on gas-980118 Marty Leisner
@ 1998-01-21 18:50 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 1998-01-21 18:50 UTC (permalink / raw)
  To: leisner; +Cc: bfd

   Date: Mon, 19 Jan 1998 13:28:58 PST
   From: "Marty Leisner" <leisner@sdsp.mc.xerox.com>

   At line 5518, sec == sec->output_section and sec->name = "*ABS*", hence
   the link fails...

I doubt you need a loader reloc against an absolute symbol at all, and
I'm not sure why the linker thinks you need one.  You probably can't
just skip emitting one in xcoff_link_input_bfd.  You probably have to
skip counting it in xcoff_mark as well.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-01-21 18:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-19 13:30 problem with ppc-aix on gas-980118 Marty Leisner
1998-01-21 18:50 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).