This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Always define referenced __start_SECNAME/__stop_SECNAME

On Wed, Jun 14, 2017 at 06:20:47AM -0700, H.J. Lu wrote:
> On Tue, Jun 13, 2017 at 8:50 PM, Alan Modra <> wrote:
> > I see these fails.  Please investigate and fix.  The powerpc-linux
> Most of tests are supported on targets without --gc-sections support or
> with a leading underscore in symbol name.  I checked in a couple patches
> to address them.
> > fails are due to leaving the __start and __stop symbols undefined when
> > sizing dynamic sections, which is wrong.  That at least needs to be
> There is no need to discard relocs on undefined symbols with
> non-default visibilty, which may be defined later like __start_SECNAME
> and __stop_SECNAME, or are real errors.  I am enclosing a patch here.

No, it is quite reasonable to discard these relocations, and it is a
maintenance nightmare when symbols change state between
allocate_dynrelocs and relocate_section.  Granted, that already
happened for .startof. and .sizeof. symbols, but the existence of
those special symbols was an undocumented feature of gas and ld.
Making that happen for __start and __stop too just makes the problem

In future please state on the mailing list which targets you tested
against when posting global changes.  I assumed you had tested this
change against a representative set of targets, but it's clear you

Alan Modra
Australia Development Lab, IBM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]