This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Patch for ppc _SDA_BASE_ value
- To: GNU binutils <binutils at sourceware dot cygnus dot com>
- Subject: Re: Patch for ppc _SDA_BASE_ value
- From: Momchil Velikov <velco at fadata dot bg>
- Date: Thu, 23 Mar 2000 22:27:43 +0200
- CC: Ian Lance Taylor <ian at zembu dot com>
Ian Lance Taylor wrote:
> Date: Thu, 23 Mar 2000 01:22:28 +0200
> From: Momchil Velikov <velco@fadata.bg>
>
> > + /* Make sure _SDA_BASE_ and _SDA2_BASE_ are at offset <= 32768 from the
> > + beginning of the respective output section. */
> >
> > That isn't the right check, though. What you really want to ensure is
> > that _SDA_BASE_ (_SDA2_BASE_) is at an offset <= 32768 from the start
> > of where the .sdata (.sdata2) section is in the output file.
> >
> > Consider
> > .data : { *(.data) *(.sdata) *(.sdata2) }
> > where the input .data sections are larger than 65536 bytes in total.
>
> I see. How about adding a call to a new backend function, say
> something like find_suitable_defaults_for_special_symbols(),
> in elf_bfd_final_link(), somewhere before the loop which calls
> elf_link_input_bfd(), which function in the PPC case would
> traverse all the .sdata sections in all the input bfd's,
> get the range [first small data item address, last small data item
> address]
> and put _SDA_BASE_ somewhere in between ?
>
> I think you could do this in size_dynamic_sections.
But neither output_section->vma nor output_offset are initialized
at the time size_dynamic_sections is called. How about
ldemul_after_allocation() ?
Regards,
-velco