Yet another unnecessary powerpc section
Alan Modra
amodra@bigpond.net.au
Tue Mar 22 12:06:00 GMT 2005
On Mon, Mar 21, 2005 at 08:18:55PM -0800, H. J. Lu wrote:
> On Tue, Mar 22, 2005 at 01:46:17PM +1030, Alan Modra wrote:
> > On Tue, Mar 22, 2005 at 12:30:03AM +1030, Alan Modra wrote:
> > > * scripttempl/elf.sc (SBSS): Don't provide sbss start and end syms.
> >
> > Sigh. It appears my search through source wasn't comprehensive enough.
> > libgloss uses __sbss_start and __sbss_end.
> >
> > * elf32-ppc.c (set_linker_sym): New function, extracted from..
> > (ppc_elf_set_sdata_syms): ..here. Expand comment. Set .sbss
> > start and end syms.
> >
> > +/* Set _SDA_BASE_, _SDA2_BASE, and sbss start and end syms. They are
> > + set here rather than via PROVIDE in the default linker script,
> > + because using PROVIDE inside an output section statement results in
> > + unnecessary output sections. Using PROVIDE outside an output section
> > + statement runs the risk of section alignment affecting where the
> > + section starts. */
> >
>
> We had the same problem with __XXX_array_start/__XXX_array_end. I am
> running into the same problem for a different issue. Can we can make
> this a generic ELF function:
>
> void bfd_elf_provide_symbol (struct bfd_link_info *,
> const char *sym_name,
> asection *sec,
> bfd_vma val);
>
> It will define a hidden data symbol NAME defined in SEC with value VAL
> if it is undefined.
If you need it, go ahead and steal it. :) The function probably ought
to start with '_' to indicate that it's not part of the public bfd
interface.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list