From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C356C3858CD1; Sun, 10 Dec 2023 12:01:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C356C3858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702209713; bh=GnEiwBRpPrQOWCDts5JGb1SeNLZh2DEsLu7tB6lRgyI=; h=From:To:Subject:Date:From; b=ady/AOKk6AENVzUpZxVDJbOtUb9eD0oW/BoUErVtNUxRRgYn2cWKaHM5IDXBzOQY/ g1CFYySyfQHaxvE82FXfaIwdMH6ddPSJvAiXbJAeBXO/sbpDqN2Ig8tE7FNRT5YhXb SPwFEJmh7CO9lSVuOWgz1kvwgfNvDO1JngHIKYUs= From: "gjl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112944] New: AVR: Support .rodata in Flash for Devices with FLMAP Date: Sun, 10 Dec 2023 12:01:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gjl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112944 Bug ID: 112944 Summary: AVR: Support .rodata in Flash for Devices with FLMAP Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: gjl at gcc dot gnu.org Target Milestone: --- Devices from the AVR64* and AVR128* families (from avrxmega2 and avrxmega4) see a 32 KiB portion of their program memory in the RAM address space. Which 32 KiB segment is visible is determined by the bit-field NVMCTRL_CTRLB.FLMAP. This can be used to place .rodata in flash (it's currently located in RAM l= ike for all other AVR devices, except the ones from avrtiny and avrxmega3). * The user should be able to chose the old .rodata location by means of a command line option like, say -mrodata-in-ram. This is needed to return to the current behaviour with rodata in RAM if desired. * The user may chose which 32 KiB block holds the rodata section. * In all cases, the default configurations should work correctly without any user interventions / special code, irrespective of -m[no-]rodata-in-ram. * The multilib structure is unchanged. Locating .rodata in flash requires new linker description files which is addressed by Binutils https://sourceware.org/PR31124. The compiler part of the implementation is to: * Add new command line options -m[no-]rodata-in-ram and -mflmap. * Use the new / previous emulations according to -mmcu=3D and-m[no-]rodata-in-ram. * Diagnose wrong usage of -m[no-]rodata-in-ram. * Provide built-in macros __AVR_HAVE_FLMAP__ and __AVR_RODATA_IN_RAM__. * Don't link __do_copy_data for .rodata objects.=