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

Georg-Johann Lay avr@gjlay.de
Mon May 28 09:51:00 GMT 2012


This bug is because an empty .data will be removed by the ld machinery.

However, .bss and other following sections get their placement after
.data, and if .data is removed and the default section start of .data
is used, the following sections start at a wrong place. Typically,
they start in some I/O location instead of at RAM start.

The start of .data is not encoded for each device in binutils.
Instead, the compiler passes -Tdata= per linker SPEC in order to
inform binutils where RAM starts.

The patch just adds KEEP for .data.

Lightly tested with a small example.

If the patch is approved, please also install is and
maybe also backport to 2.22.

Johann

ld/
     PR 13697
     * scripttempl/avr.sc (.data): Keep it.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr13697.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20120528/85b4515a/attachment.ksh>


More information about the Binutils mailing list