[Patch,AVR]: Fix PR13697: Wrong symbols with --gc-sections

Georg-Johann Lay avr@gjlay.de
Thu May 31 06:50:00 GMT 2012

Hans-Peter Nilsson schrieb:

> If you think the current behavior from --gc-sections is plain
> wrong (i.e. even without -Tdata), don't use it.  

It's not about me using that option.

It's about avr-gcc's users using that options which shreds their
applications if .data is empty which can happen for small µC

I am working on avr-gcc and have some bugs there that accumulated
over time, and now the pain in ass is avr-binutils with its
accumulated bugs...

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*.

And as long as there is so much resistance to restore reasonable
behavior (not move . backwards) I am fine with the suboptimal
patch if it avoids users applications to break.

> Alan pointed at two test-cases asserting the current behavior.

As I already said it's a bug to move the location counter backwards.
That's beyond anything you'd expect.


More information about the Binutils mailing list