This is the mail archive of the
mailing list for the binutils project.
Re: [patch,avr] PR21472: Upgrade emulation avrxmega3 so it has .rodata in flash instead of in SRAM.
- From: Nick Clifton <nickc at redhat dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>, Senthil Kumar Selvaraj <senthilkumar dot selvaraj at microchip dot com>
- Cc: binutils at sourceware dot org, Denis Chertykov <chertykov at gmail dot com>, Pitchumani Sivanupandi <pitchumani dot sivanupandi at microchip dot com>, Joerg Wunsch <joerg_wunsch at uriah dot heep dot sax dot de>
- Date: Tue, 9 May 2017 11:54:43 +0100
- Subject: Re: [patch,avr] PR21472: Upgrade emulation avrxmega3 so it has .rodata in flash instead of in SRAM.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=nickc at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 27822624CB
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 27822624CB
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com>
>> On 09.05.2017 07:51, Senthil Kumar Selvaraj wrote:
>> I'm still not convinced we need a new emulation for this.
I would really prefer it if you two can come to an agreement about
the best way to handle this. I am not adverse to adding a new emulation
if this is what you want, but I would be worried if this leads to an
explosion in the number of linker scripts later on.
> I don't see a way how to provide a linker description file without
> supplying a new emulation.
How about defining __RODATA_PM_OFFSET__ on the linker command line
and using the current avrtiny.sc script ?
>>> diff --git a/ld/emulparams/avrxmega3.sh b/ld/emulparams/avrxmega3.sh
>>> index abaa5b3..504c492 100644
>>> --- a/ld/emulparams/avrxmega3.sh
>>> +++ b/ld/emulparams/avrxmega3.sh
>>> @@ -1,6 +1,6 @@
I would much prefer it if you did not create a new script, but instead added
parametrisation to the current avr and avrtiny scripts. (In fact it would be
even better if you could combine avr.sc and avrtiny.sc and just have one script).
The reason for this is that the more scripts you have, the greater the chances
of making an error or missing one out when it comes to future changes.
Take a look at the elf.sc script. It is used by lots of different targets, but
it is highly customizable via definitions in the target's specific emulparams
The alternative approach, which I would also consider to be reasonable, is to have
a base avr script that defines all of the things that are consistent between all
three proposed avr linker scripts and to include this script into smaller,
avr-variant scripts that just defines those things that are specific to that variant.
Kind of like how the DWARF.sc script is included into the elf.sc script.