This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS patch to correct the size of %neg() fixups


Richard Sandiford wrote:
> This code:
> 
> foo:
> 	lui	$2,%hi(%neg(%gp_rel(foo)))
> 	sub	$sp,$sp,28
> 
> causes an internal error:
> 
>     /tmp/abort.s:2: Error: internal error: fixup not contained within frag
> 
> gas is creating a separate fixup for the each relocation operator
> in the first instruction.  The size of the fixup is determined
> by the corresponding relocation's howto.
> 
> Problem is, R_MIPS_SUB is a 64-bit relocation, so it gets a 64-bit
> fixup.  The "sub" macro then forces the start of a new frag, so the
> R_MIPS_SUB fixup goes beyond the end of the old frag.
> 
> As I understand it, the relocation field should be determined
> by the outermost operator (%hi() in this case) and all three
> fixups should use that size.

That's probably a too simple approach for the genaral case, since e.g. a

R_MIPS_GPREL(sym)
R_MIPS_64(null)

sequuence is supposed to produce a 64bit addend. AFAICS the relocation
field size in all relocations of a triple should be the largest one
encountered there.


Thiemo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]