This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Linker script using INSERT AFTER
On Mon, Oct 26, Daniel Jacobowitz wrote:
> 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.
You are right, it is a symbol that is linker generated because it finds the
section named __markers.
Regards,
Jan
--
Jan Blunck <jblunck@suse.de>