This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch, avr] Prevent .noinit section from incorrect placement
- From: Denis Chertykov <chertykov at gmail dot com>
- To: "Sivanupandi, Pitchumani" <Pitchumani dot Sivanupandi at atmel dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, Georg-Johann Lay <avr at gjlay dot de>
- Date: Mon, 25 Jan 2016 22:40:01 +0300
- Subject: Re: [patch, avr] Prevent .noinit section from incorrect placement
- Authentication-results: sourceware.org; auth=none
- References: <CAC140656783604CABA6AE60C2A6D5A4CA3BD8C8 at penmbx02 dot corp dot atmel dot com>
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.