Bug 21569 - [avr] Make avr.sc so generic that there is no need for avrtiny.sc.
Summary: [avr] Make avr.sc so generic that there is no need for avrtiny.sc.
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P3 enhancement
Target Milestone: 2.29
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-12 11:29 UTC by Georg-Johann Lay
Modified: 2017-06-15 16:36 UTC (History)
0 users

See Also:
Host:
Target: avr
Build:
Last reconfirmed:


Attachments
Proposed patch (1.80 KB, patch)
2017-06-12 11:36 UTC, Georg-Johann Lay
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Georg-Johann Lay 2017-06-12 11:29:13 UTC
Currently, we have 2 script templates for avr.  As proposed by Nick, these files should be unified in such a way that one script template is sufficient.
Comment 1 Georg-Johann Lay 2017-06-12 11:36:46 UTC
Created attachment 10093 [details]
Proposed patch

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

        * 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.
Comment 2 Sourceware Commits 2017-06-13 15:51:44 UTC
The master branch has been updated by Nick Clifton <nickc@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6490dc678bc35f2204afb38449de5127ef8bcca0

commit 6490dc678bc35f2204afb38449de5127ef8bcca0
Author: Georg-Johann Lay <avr@gjlay.de>
Date:   Tue Jun 13 16:50:26 2017 +0100

    Replace multiple AVR scripts with a single, customizable linker script.
    
    	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.
Comment 3 Georg-Johann Lay 2017-06-15 16:35:03 UTC
Done.