Linker script using INSERT AFTER

Daniel Jacobowitz drow@false.org
Tue Oct 27 02:29:00 GMT 2009


On Tue, Oct 27, 2009 at 09:56:34AM +1030, Alan Modra wrote:
> > Anyway, since I though that it isn't necessary to add an empty section (if
> > __start___markers isnt' there I know that the section will be empty anyway) I
> > thought that I can live with the following:
> > 
> > SECTIONS
> > {
> > 	PROVIDE_HIDDEN(__start___markers = .);
> > 	PROVIDE_HIDDEN(__stop___markers = .);
> > 
> > 	PROVIDE_HIDDEN(__start___tracepoints = .);
> > 	PROVIDE_HIDDEN(__stop___tracepoints = .);
> > }
> > INSERT AFTER .data;
> > 
> > That actually works, but it seems to override the hidden symbol that comes
> > with on of the objects to link with. Somehow I think this isn't correct due to
> > the description of PROVIDE_HIDDEN().
> 
> PROVIDE and PROVIDE_HIDDEN should only provide definitions for
> undefined or common symbols.  Perhaps you have one of the latter?

Is the symbol being overridden really in one of the input files?  Or
is it linker created from a section named "__markers"?  Maybe the
section symbols are being generated by ld after PROVIDE_HIDDEN is
processed.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Binutils mailing list