[PATCH] elf: Discard input .note.gnu.build-id sections

Alan Modra amodra@gmail.com
Wed Dec 1 07:23:02 GMT 2021
On Tue, Nov 30, 2021 at 08:46:04PM -0800, H.J. Lu via Binutils wrote:
> 1. Discard input .note.gnu.build-id , excluding the first one.
> 2. Clear the build ID field before writing.
> 3. Use the input .note.gnu.build-id section if available.

It's simpler to mark all input .note.gnu.build-id sections with
SEC_EXCLUDE then use bfd_make_section_anyway_with_flags to create a
new section.  That way you'll avoid any problems that might occur when
trying to use an existing section.  For example, the size might change
with a change in build-id style, leading to section contents buffer
overflow.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list