Re: Modify Xtensa instruction relaxation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 3, 2023 at 6:04 AM <daniel@xxxxxxxxxxx> wrote:
> But now I'm hitting an assertion in write.c: "Internal error in
> cvt_frag_to_fill"
>
> I checked, its this part of the code:
>      gas_assert (fragP->fr_next == NULL || (fragP->fr_next->fr_address -
> fragP->fr_address == fragP->fr_fix));
>
> fr_next seems to be ok, but the difference between fr_address seems to
> be off by 3, fr_fix seems to be 3 higher then the difference of
> fr_address in the current and the next fragP.
>
> Any idea how that can be the case?

If you change the frags too late in the process their addresses
may have been used by that time to make decisions like where
to put a literal so it's reachable or whether a trampoline is needed
for a jump.

> Strangely, if I leave the check for is_last_fragment away, it works.

It may fail later in opcode conversion to binary form if new offsets
won't fit, or it may generate code that references wrong addresses.
E.g. try to have a jump around the code that is modified by your
change and see whether the disassembly still looks correct.

-- 
Thanks.
-- Max




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux