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


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_ ?

Regards,
-velco

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