From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Mitchell To: geoffk@ozemail.com.au Cc: gavin@cygnus.com, binutils@sourceware.cygnus.com, brendan@cygnus.com Subject: Re: Reloc changes to bfd/elf32-mips.c Date: Tue, 28 Sep 1999 22:16:00 -0000 Message-id: <19990928222137W.mitchell@codesourcery.com> References: <199909271118.VAA01663@gluttony.geoffk.wattle.id.au> <19990928005956V.mitchell@codesourcery.com> <199909290330.NAA00657@gluttony.geoffk.wattle.id.au> X-SW-Source: 1999-09/msg00201.html >>>>> "Geoff" == Geoff Keating writes: Geoff> For instance, the following .s file: Geoff> l1: b l2 l3: lw $5,%lo(l1+0x10004)($2) b l4 l2: lui Geoff> $2,%hi(l1+0x10004) add $3,$2,$3 lw $4,%lo(l1+0x10004)($3) b Geoff> l3 l4: Geoff> produces the following relocs from gas: Geoff> RELOCATION RECORDS FOR [.text]: OFFSET TYPE VALUE Geoff> 000000000000000c R_MIPS_LO16 .text 0000000000000010 Geoff> R_MIPS_HI16 .text 000000000000001c R_MIPS_LO16 .text Geoff> Contents of section .text: 0000 10000003 00000000 10000005 Geoff> 8c450004 .............E.. 0010 3c020001 00431820 1000fffb Geoff> 8c640004 <....C. .....d.. Geoff> which used to cause ld to fail with an error. gcc can Geoff> generate control flows like this (although some of the Geoff> branches have to be conditional). I think it's OK to have `ld' (as an extension) handle this case. But, we really should fix GAS. It would be useful (I know this because customers have told me so :-)) to be able to assemble things with GAS, but link them with the MIPS linker. The .o files that GAS creates are not ABI-compliant, and not for any particularly good reason. (In other words, I don't see a real performance improvement/useful feature that the "incorrect" ordering buys you.) That's an irrelevant paragraph, from the point of view of the goodness of your patch. -- Mark Mitchell mark@codesourcery.com CodeSourcery, LLC http://www.codesourcery.com