Skip to content

link time optimization (-lto) of AVR breaks inclusion of debug info in elf file #5539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
WestfW opened this issue Oct 31, 2016 · 2 comments
Closed

Comments

@WestfW
Copy link
Contributor

WestfW commented Oct 31, 2016

In recent versions of avr-gcc, the -g option is needed during compile in order to get enough debug information into the final elf file for things like a combined source/disassemebly (avr-objdump -SC foo.elf) to work. Now that link time optimization has been implemented, the "link" command will need the -g option as well as the individual compiles...

(It's possible that some other compile-time options also need to be moved to the link statement as well, but "-g" is the one I noticed.)

@facchinm
Copy link
Member

facchinm commented Nov 2, 2016

Hi @WestfW ,
does it impact the size of the final hex (once the debug sections have been removed of course)? If it doesn't, I believe we could simply add the -g flag everywhere. Otherwise we'll need to provide a way to override the commandline in order to produce a debuggable elf

@matthijskooijman
Copy link
Collaborator

The .hex file is unaffected, so I would encourage adding -g.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants