Bug 31177 - AVR: Use __TEXT_REGION_ORIGIN__ as start for MEMORY region text
Summary: AVR: Use __TEXT_REGION_ORIGIN__ as start for MEMORY region text
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P3 enhancement
Target Milestone: 2.42
Assignee: Georg-Johann Lay
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-17 18:06 UTC by Georg-Johann Lay
Modified: 2023-12-18 10:17 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georg-Johann Lay 2023-12-17 18:06:11 UTC
The start of MEMORY region text currently starts hard-coded at 0.

The linker can produce more exact diagnostics when it knows the exact placements of the memory regions.

For some old devices, program memory starts at 0x8000, so allow to specify program memory start at __TEXT_REGION_ORIGIN__ similar to how the data region is described.
Comment 1 Sourceware Commits 2023-12-18 10:05:57 UTC
The master branch has been updated by Nick Clifton <nickc@sourceware.org>:

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

commit d51cd0f64c6d3bd235f140ed71cc2c3e0b87a5ff
Author: Georg-Johann Lay <avr@gjlay.de>
Date:   Sun Dec 17 19:20:54 2023 +0100

    PR31177: Let region text start at __TEXT_REGION_ORIGIN___
    
    The start of MEMORY region text currently starts hard-coded at 0.
    
    The linker can produce more exact diagnostics when it knows the exact placements of the memory regions.
    
    For some old devices, program memory starts at 0x8000, so allow to specify program memory start at __TEXT_REGION_ORIGIN__ similar to how the data region is described.
    
    If ok, please apply to master.
    This one is also fine to back-port.
    
    Johann
    
    --
    
    AVR: Use __TEXT_REGION_ORIGIN__ as start for MEMORY region text.
    
    ld/
            PR 31177
            * scripttempl/avr.sc (__TEXT_REGION_ORIGIN__): New symbol.
            (MEMORY): Use as start address for the text region.
Comment 2 Georg-Johann Lay 2023-12-18 10:17:11 UTC
Added in 2.42