From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4AFF43858C56; Mon, 12 Feb 2024 11:04:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4AFF43858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707735883; bh=YLKVr4Aou7MZTlR2FRNabcM9N7tgVpV/xhd6D2c9q9A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NAvjkuQ/Y/Vqk52wwGGH/LPMbh5e62HWktrVD37nbNMfxbcRWNAQjzYZeVbIJWjg5 7DWj348SqJ9NcdTd9aX5S0wk++miFbyG0yUXwkqHRrrG5d+qSi3LQtEM4LHwRwU31o 0iy0Kz9/jvQ09Kay0T8X9a+yjOzpAwV1P54H6VDg= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112944] AVR: Support .rodata in Flash for Devices with FLMAP Date: Mon, 12 Feb 2024 11:04:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: gjl at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 --- Comment #4 from GCC Commits --- The master branch has been updated by Georg-Johann Lay : https://gcc.gnu.org/g:525cfe1e9554858366e7811aa9e437357c0f272e commit r14-8926-g525cfe1e9554858366e7811aa9e437357c0f272e Author: Georg-Johann Lay Date: Mon Feb 12 11:10:48 2024 +0100 AVR: target/112944 - Addendum: Link code to initialize NVMCTRL_CTRLB.FL= MAP For devices that see a part for the flash memory in the RAM address spa= ce, bit-field NVMCTRL_CTRLB.FLMAP must match the value of symbol __flmap. This is achieved by dragging in startup code from lib.a. The mechanism is the same like for libgcc's __do_copy_data and __do_clear_bss. The code is implemented in AVR-LibC #931 and can be dragged by referenc= ing __do_flmap_init. In addition to setting FLMAP, that code also sets bit FLMAPLOCK provided symbol __flmap_lock has a non-zero value. This protects FLMAP from fut= ure changes. When the __do_flmap_init code is not wanted, the symbol can be satisfie= d by linking with -Wl,--defsym,__do_flmap_init=3D0 gcc/ PR target/112944 * config/avr/gen-avr-mmcu-specs.cc (print_mcu) [have_flmap]: <*link_rodata_in_ram>: Spec undefs symbol __do_flmap_init when not linked with -mrodata-in-ram.=