This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ld errors -- wrong output section for SDAREL target


   Date: Sun, 19 Mar 2000 23:26:03 +0200
   From: Momchil Velikov <velco@fadata.bg>
   X-Accept-Language: en
   Content-Type: text/plain; charset=us-ascii

   Momchil Velikov wrote:
   > All the objects were compiled with the -msdata option. The relevant
   > portion of the
   > ld script is:
   > 
   >   . = ALIGN(0x1000);
   >   .data :
   >    { *(.data)
   >      *(.gnu.linkonce.d*)
   >      _SDA_BASE_ = . + 32768;
   >      PROVIDE(__ctors_start = .);
   >      *(.ctors)
   >      PROVIDE(__ctors_end = .);
   >      *(.sdata)
   >    }
   > 
   >   _edata  =  .;
   >   PROVIDE (edata = .);
   > 
   >   .bss                  : { *(.sbss) *(.bss) *(COMMON)                  }
   >   _end = . ;
   >   PROVIDE (end = .);
   > 
   > Yep, it's somewhat unusual. The reason is the bogus bootloader (Apple OF
   > 1.0.5)
   > -- it initializes only .text, .data and .bss sections.
   > 
   > Does anybody have an idea how to cope with this situation ?
   > Is is possible for the linker to relocate against the value of
   > _SDA_BASE_ ?

   Well, looking closer, the linker DOES relocate against the value of
   _SDA_BASE_ and not against the beginning of .sdata.

   Ian Lance Taylor wrote:
   > BFD appears to assume that those relocations are against the start of
   > the .sdata/.sbss output section.  Assuming that is correct, then you
   > must have a .sdata/.sbss output section if you want to use those
   > relocation.

   Why is the output section restriction ? Why not simply ignore what the
   output section is and let the BFD report relocation overflow if
   the symbol is too far away from _SDA_BASE_ ?

I don't know.  Michael, I think you wrote this code.  The code in
question is in ppc_elf_relocate_section and a couple of other places.
It explicitly checks whether the output section of a R_PPC_SDAREL16
relocation is in the .sdata or .sbss section.  Do you remember why it
does this?

Ian

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]