binutils-gdb/ld/scripttempl
H.J. Lu 0a71d78f6a ld: Don't explicitly add .note.gnu.build-id in elf.sc
The commit:

e8e10743f7 Add --rosegment option to BFD linker to stop the '-z separate-code' from generating two read-only segments.

places .note.gnu.property and text sections in the same PT_LOAD segment
when --rosegment and -z separate-code are used together.  After

commit f3e660db14
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Oct 8 04:39:09 2018 -0700

    ELF: Properly group and place orphan note sections

    Properly group orphan note sections.  When placing orphan note section
    as the first note section, place it after the section before all note
    sections.

ld properly groups and places orphan note sections.  If .note.gnu.build-id
is added to elf.sc, the orphan .note.gnu.property section will be placed
before the .note.gnu.build-id section due to the larger section alignment
and may be placed in the same PT_LOAD segment with text sections.  Remove
.note.gnu.build-id from elf.sc to let ld properly group and add all orphan
note sections.

Binutils 2.44 has been fixed by a different fix:

commit 052940eba6
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Sep 20 11:32:26 2024 +0800

    ld: Ignore .note.gnu.build-id when placing orphaned notes

since .note.gnu.build-id has been removed from emit_early_ro in elf.sc.

	PR ld/32191
	* scripttempl/elf.sc (emit_early_ro): Remove .note.gnu.build-id.
	* testsuite/ld-i386/i386.exp: Run PR ld/32191 test.
	* testsuite/ld-i386/pr32191.d: New file.
	* testsuite/ld-x86-64/pr32191-x32.d: New file.
	* testsuite/ld-x86-64/pr32191.d: Likewise.
	* testsuite/ld-x86-64/pr32191.s: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Run PR ld/32191 tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-09-28 06:34:39 +08:00
..
aix.sc
alpha.sc
alphavms.sc
aout.sc
arclinux.sc
avr.sc
crisaout.sc
dlx.sc
DWARF.sc
elf32cr16.sc
elf32crx.sc
elf32msp430.sc
elf64bpf.sc
elf64hppa.sc
elf.sc ld: Don't explicitly add .note.gnu.build-id in elf.sc 2024-09-28 06:34:39 +08:00
elfarc.sc
elfarcv2.sc
elfd10v.sc
elfd30v.sc
elfm9s12z.sc
elfm68hc11.sc
elfm68hc12.sc
elfmicroblaze.sc
elfxgate.sc
elfxtensa.sc
epiphany_4x4.sc
ft32.sc
hppaelf.sc
i386beos.sc
i386go32.sc
i386msdos.sc
ia64vms.sc
ip2k.sc
iq2000.sc
mcorepe.sc
mep.sc
mips.sc
misc-sections.sc
mmo.sc
moxie.sc
nds32elf.sc
pdp11.sc
pe.sc
pep.sc
pj.sc
pru.sc
README
sh.sc
tic4xcoff.sc
tic30coff.sc
tic54xcoff.sc
v850_rh850.sc
v850.sc
vanilla.sc
visium.sc
xstormy16.sc
z80.sc
z8000.sc

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

The files in this directory are linker script templates.
genscripts.sh sets some shell variables, then sources
EMULATION.sc, to generate EMULATION.{x,xr,xu,xn,xbn} -- the script
files for default, -r, -Ur, -n, -N.

Copyright (C) 2012-2024 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.