From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ralf Baechle To: Mark Mitchell Cc: binutils@sourceware.cygnus.com Subject: Re: R_MIPS_26 testcase Date: Wed, 04 Aug 1999 14:02:00 -0000 Message-id: <19990804230046.B15625@uni-koblenz.de> References: <19990804171542.A15318@uni-koblenz.de> <19990804134926T.mitchell@codesourcery.com> X-SW-Source: 1999-08/msg00025.html On Wed, Aug 04, 1999 at 01:49:26PM -0700, Mark Mitchell wrote: > I think I already fixed this. I get: > > Disassembly of section .text: > > 0000000000000000 : > ... > > 0000000000018000 : > 18000: 3c020002 lui $v0,0x2 > 18000: R_MIPS_HI16 .text > 18004: 24428000 addiu $v0,$v0,-32768 > 18004: R_MIPS_LO16 .text > ... > > which looks like the right thing to me: 0x20000 - 0x8000 = 0x18000 > unless I'm really losing it. Yep, test cases #7 and #8 are ok now. #6 still is broken. Shifting left of the the jump destination has to be done before adding something to it like in this patch fragment: @@ -6581,6 +6573,9 @@ /* There's nothing to do for non-local relocations. */ continue; + if (r_type == R_MIPS_26) + addend <<= 2; + r_symndx = ELF32_R_SYM (rel->r_info); sym = local_syms + r_symndx; if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) Ralf