[patch,avr] Fix PR21569

Georg-Johann Lay avr@gjlay.de
Mon Jun 12 11:51:00 GMT 2017


As proposed by Nick, this patch makes avr.sc so generic
that avrtiny.sc is no more needed and avr.sc can be used
also for avrtiny.

The patch introduces some new variables to factor out the
differences.

The patch is written in such a way that all changes will be
in the generated scripts avrtiny.x* and all non-tiny
scripts remain the same.  Hence easy to verify by comparing
the new avrtiny.x* against the ones from an existing install.

The changes in avrtiny.x* are due to different (trailing)
spaces in the original avrtiny.sc compared to avr.sc
which I didn't fix, dito for a source comment which
I didn't include in avr.sc for easier maintenance.

If it's ok for master, please someone commit it.

Please notice that scripttempl/avrtiny.sc has to be
removed by hand, I didn't find a way to include the
removal in the delta below.

Johann

ld/
	Genericize avr.sc so that it also works for avrtiny.

	PR ld/21569
         * scripttempl/avrtiny.sc: Remove file.

	* Makefile.am (eavrtiny.c): Depend on avr.sc, no more on avrtiny.sc.
	* Makefile.in: Regenerate.
	* emulparams/avrtiny.sh (SCRIPT_NAME): Set var to "avr".
	(TEXT_ORIGIN): Remove var.
	(FUSE_NAME, FUSE_LENGTH, LOCK_LENGTH, SIGNATURE_LENGTH)
	(RODATA_PM_OFFSET): Set new vars.
	* emulparams/avr1.sh (FUSE_NAME, EEPROM_LENGTH, FUSE_LENGTH)
	(LOCK_LENGTH, SIGNATURE_LENGTH, USER_SIGNATURE_LENGTH): Set new vars.
	* emulparams/avr2.sh: Same.
	* emulparams/avr25.sh: Same.
	* emulparams/avr3.sh: Same.
	* emulparams/avr31.sh: Same.
	* emulparams/avr35.sh: Same.
	* emulparams/avr4.sh: Same.
	* emulparams/avr5.sh: Same.
	* emulparams/avr51.sh: Same.
	* emulparams/avr6.sh: Same.
	* emulparams/avrxmega1.sh: Same.
	* emulparams/avrxmega2.sh: Same.
	* emulparams/avrxmega3.sh: Same.
	* emulparams/avrxmega4.sh: Same.
	* emulparams/avrxmega5.sh: Same.
	* emulparams/avrxmega6.sh: Same.
	* emulparams/avrxmega7.sh: Same.
	* scripttempl/avr.sc (__EEPROM_REGION_LENGTH__): Only define
	if EEPROM_LENGTH is set.
	(MEMORY) [eeprom]: Same.
	(SECTIONS) [.eeprom]: Same for output section.
	(__USER_SIGNATURE_REGION_LENGTH__): Only define if
	USER_SIGNATURE_LENGTH is set.
	(MEMORY) [user_signatures]: Same.
	(SECTIONS) [.fuse]: Only define output section if FUSE_NAME = fuse.
	(SECTIONS) [.config]: Only define output section if FUSE_NAME = config.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-unify-avrsc.diff
Type: text/x-patch
Size: 11110 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170612/8d0f5ff9/attachment.bin>


More information about the Binutils mailing list