From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6637 invoked by alias); 13 Dec 2011 00:20:30 -0000 Received: (qmail 6628 invoked by uid 22791); 13 Dec 2011 00:20:29 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,TW_CP,TW_FN X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Dec 2011 00:20:15 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 8615E1B4014 for ; Tue, 13 Dec 2011 00:20:14 +0000 (UTC) From: Mike Frysinger To: libc-ports@sourceware.org Subject: [patch] handle unaligned arm abs relocs Date: Tue, 13 Dec 2011 00:20:00 -0000 User-Agent: KMail/1.13.7 (Linux/3.1.0-atsc; KDE/4.6.5; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart11131366.i5PWt7nKfO"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201112121920.17908.vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00017.txt.bz2 --nextPart11131366.i5PWt7nKfO Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-length: 1217 background can be found here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D51456 patch is below -mike 2011-12-12 Mike Frysinger * dl-machine.h (elf_machine_rel, R_ARM_ABS32): Declare "reloc_value". Replace reloc_addr addition with memcpy's. diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index 5ceeaa9..fe64800 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -413,6 +413,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel= =20 *reloc, break; case R_ARM_ABS32: { + Elf32_Addr reloc_value; # ifndef RTLD_BOOTSTRAP /* This is defined in rtld.c, but nowhere in the static libc.a; make the reference weak so static programs can @@ -431,7 +432,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel= =20 *reloc, used while loading those libraries. */ value -=3D map->l_addr + refsym->st_value; # endif - *reloc_addr +=3D value; + /* Support relocations on mis-aligned offsets. */ + memcpy (&reloc_value, reloc_addr_arg, sizeof (reloc_value)); + reloc_value +=3D value; + memcpy (reloc_addr_arg, &reloc_value, sizeof (reloc_value)); break; } case R_ARM_TLS_DESC: --nextPart11131366.i5PWt7nKfO Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 836 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJO5ppBAAoJEEFjO5/oN/WBFywQANANglx3/s72RjGsG5a7dRsB j51SlmTy2TxPuLwIgKyeRU3HO8ujdhgaZPa4blJxVQVzPP7r/r4PmyrhYZrQtPRZ 7N+BBtCkwM6GuErNIARHAkxn+J4lolE/9iJQz9Hahmhyn/5EE00PVlUhz4v4Kw9Y 0wBf93ooEN/lfGVaFcVL2d2RhcXn0IKpXY6w2AamXwjT1IyRAfhQ304pdcxFiqn8 OV3qiDME16dcqF7G4H7Bn9eS1TnC9RzEGo33R2isrDUrkhc1MJ1i24cdooLgJpKv BNgY0olelWwgztYn6fU5afc0w8w5YiLKXQaHeKruE6l98P6mqbHWZG3RdF/W5Bsu 6IjQRJy+lF+a4yXHOFtboT2YKHJJ0pda3//SCN1p+MX+WMnQIdpVNpKImfMPwwU7 a7VrOWMvzUl2Dn+BlBCYxD6ajAMU+ID4rmcxwpUWLy9ukTvYk+9/SI/3IEMQqKCR 6bZ9r4LN3XIVggx6NiA36fPewfCYhnuTXLH4pa/2TkD6JoKAmQHfBYzodc1HhaSy kfsanAE46J6HVwfK/J5j8WuFn17qIzsteJD3sZJv4roUUzSxLoLNF6HxuWNmUSCg 1GCRY6psJ04xZ2fuCOkzkehajCe6wqscuh5W8e+GL6521GyQl7Dy3KacC2H8Bkue trvrB1iPnBBQOQH5KjEq =Pqu1 -----END PGP SIGNATURE----- --nextPart11131366.i5PWt7nKfO--