[patch, avr] Prevent .noinit section from incorrect placement

Denis Chertykov chertykov@gmail.com
Mon Jan 25 19:40:00 GMT 2016


2016-01-22 11:38 GMT+03:00 Sivanupandi, Pitchumani
<Pitchumani.Sivanupandi@atmel.com>:
> This patch is similar to:
> https://sourceware.org/ml/binutils/2014-07/msg00033.html
>
> When .data and .bss sections are empty .noinit section is placed at data
> region's start. This will be incorrect for devices that has different
> data start address than data region start in linker script.
>
> Test case:
>   1 int volatile a __attribute__((section(".noinit")));
>   2 void main ()
>   3 {
>   4   while (1)
>   5     a++;
>   6 }
>
> avr-gcc -O1 -Wl,-gc-sections -mmcu=attiny841
>
> Below patch updates .noinit section's VMA to end of .bss section. So, .noinit
> section will be placed at .data section address (-Tdata=<address>) when .data
> and .bss sections are empty.
>
> If ok, could someone commit please? I do not have commit access.
>

Committed.

Denis.



More information about the Binutils mailing list