This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: ld errors -- wrong output section for SDAREL target
- To: GNU binutils <binutils at sourceware dot cygnus dot com>
- Subject: Re: ld errors -- wrong output section for SDAREL target
- From: Momchil Velikov <velco at fadata dot bg>
- Date: Sun, 19 Mar 2000 23:26:03 +0200
- References: <38D3F4E3.6BF5826@fadata.bg>
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