This is the mail archive of the 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: [PATCH] MIPS/binutils: microMIPS linker relaxation fixes

"Maciej W. Rozycki" <> writes:
>  So I have actually given it some more thought and my understanding of the 
> ABI remains that while orphaned R_MIPS_LO16 relocations are indeed 
> permitted, they still must be preceded by a corresponding R_MIPS_HI16, 
> although that is not required to be adjacent.  I believe this is only 
> permitted to allow cases like you quoted to avoid unnecessary extra code 
> to add missing R_MIPS_HI16 relocations.

There are still potential problems though.  We deliberately allow things like:

        lui     $4,%hi(foo)
        lw      $6,%lo(foo)($4)
        lw      $7,%lo(foo+4)($4)
        .align  8
        .word   X, Y

and foo is allowed to be in a text section.  Does your patch ensure that
foo remains 8-byte aligned, even if we relax code earlier in the section?

>  Do you have a better idea?

TBH, my inclination is to remove it from trunk too.  I imagine
GCC's LTO will catch many of the interesting cases (because then
we assemble the output object's text section at once).


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