Yet another unnecessary powerpc section

H. J. Lu hjl@lucon.org
Tue Mar 22 11:48:00 GMT 2005


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.


H.J.



More information about the Binutils mailing list