This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
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 avr.sc. 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
- References:
- Re: [Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections
- Re: [Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections
- Re: [Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections
- Re: [Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections
- Re: [Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections
- Re: [Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections
- Re: [Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections
- Re: [Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections
- Re: [Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections
- Re: [Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections