From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14735 invoked by alias); 6 Jul 2011 20:58:00 -0000 Received: (qmail 14708 invoked by uid 22791); 6 Jul 2011 20:57:57 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Jul 2011 20:57:43 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p66Kvg4P030547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Jul 2011 16:57:42 -0400 Received: from springer.wildebeest.org (ovpn-113-114.phx2.redhat.com [10.3.113.114]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p66KvfU8027849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Jul 2011 16:57:41 -0400 Received: by springer.wildebeest.org (Postfix, from userid 500) id D59D246F31; Wed, 6 Jul 2011 22:57:39 +0200 (CEST) Subject: linking elf notes together on elf32-arm From: Mark Wielaard To: binutils@sourceware.org Cc: Stan Cox , Nick Clifton Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 06 Jul 2011 23:19:00 -0000 Message-ID: <1309985859.3275.17.camel@springer.wildebeest.org> Mime-Version: 1.0 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00083.txt.bz2 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 =3D=3D SHT_NOTE) *flags |=3D 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 Nick Clifton =20=20=20=20=20=20=20=20=20=20=20 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