binutils-gdb/ld/testsuite/ld-elf/pr28639b.rd
H.J. Lu 1f1d0f8888 elf: Discard input .note.gnu.build-id sections
1. Discard input .note.gnu.build-id sections.
2. Clear the build ID field before writing.
3. Use bfd_make_section_anyway_with_flags to create the output
.note.gnu.build-id section.

	PR ld/28639
	* ldelf.c (ldelf_after_open): Discard input .note.gnu.build-id
	sections, excluding the first one.
	(write_build_id): Clear the build ID field before writing.
	(ldelf_setup_build_id): Use bfd_make_section_anyway_with_flags
	to create the output .note.gnu.build-id section.
	* testsuite/ld-elf/build-id.exp: New file.
	* testsuite/ld-elf/pr28639a.rd: Likewise.
	* testsuite/ld-elf/pr28639b.rd: Likewise.
	* testsuite/ld-elf/pr28639c.rd: Likewise.
	* testsuite/ld-elf/pr28639d.rd: Likewise.
2021-12-01 16:40:43 -08:00

7 lines
210 B
R

#...
Displaying notes found in: \.note\.gnu\.build-id
Owner Data size Description
GNU 0x00000014 NT_GNU_BUILD_ID \(unique build ID bitstring\)
Build ID: [0-9a-f]+
#pass