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,AVR]: Fix PR13697: Wrong symbols with --gc-sections

On Thu, May 31, 2012 at 03:14:49AM -0400, Hans-Peter Nilsson wrote:
> On Thu, 31 May 2012, Georg-Johann Lay wrote:
> > PR13697 appeared to be the easiest to fix so I proposed a patch.
> >
> > I am aware that the proposition is not optimal but it *works*.
> Did you understand the point that you're marking an input
> section when you should be marking the whole output section and
> that your solution will break if the whole code is compiled with
> -fdata-sections?  (Assuming no assembly code adding anything to
> .data.)  And as there isn't a way to do the latter, better mark
> all input sections.

I agree with the rest of your comments, but not this one.  I think
you'll find that gas always emits .data, which is why I gave the OK to
Johann's patch.  Marking .data as kept also shouldn't adversely effect
--gc-sections operation on -ffunction-sections -fdata-sections code.

The best solution is probably using SEGMENT_START in  That
way -Tdata would affect an assignment to dot in the script *outside*
of an output section statement, so whether or not the section is kept
becomes irrelevant.

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]