This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
linking elf notes together on elf32-arm
- From: Mark Wielaard <mjw at redhat dot com>
- To: binutils at sourceware dot org
- Cc: Stan Cox <scox at redhat dot com>, Nick Clifton <nickc at redhat dot com>
- Date: Wed, 06 Jul 2011 22:57:39 +0200
- Subject: linking elf notes together on elf32-arm
Hi,
While trying to build a program that uses sdt elf notes on an elf32-arm
architecture I get the following error on the final link:
/usr/bin/ld: staprun-util.o: duplicate section `.note.stapsdt' has
different size
The different object files do have different sized note sections,
because they contain different things and so shouldn't be merged
together as duplicates.
This is because all elf notes are marked as link once in
bfd/elf32-arm.c:
/* Set the right machine number for an Arm ELF file. */
static bfd_boolean
elf32_arm_section_flags (flags, hdr)
flagword *flags;
Elf_Internal_Shdr *hdr;
{
if (hdr->sh_type == SHT_NOTE)
*flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_SAME_CONTENTS;
return TRUE;
}
That seems wrong to me. Why are all SHT_NOTE sections treated that way?
Should it be just some specific arm named ones?
It seems to have been introduced a long time ago:
2003-03-25 Stan Cox <scox@redhat.com>
Nick Clifton <nickc@redhat.com>
Contribute support for Intel's iWMMXt chip - an ARM variant:
[...]
(elf32_arm_section_flags): New function: Set flags on note section.
Can anybody remember why that was, and how to make it so that "normal"
elf notes don't get merged?
Thanks,
Mark