This is the mail archive of the binutils@sourceware.cygnus.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]

Re: elf64-hppa branches


On Mon, 29 May 2000, Jeffrey A Law wrote:

>   In message <Pine.LNX.4.21.0005291236050.15777-100000@front.linuxcare.com.au>y
> ou write:
>   > Hi Jeff,
>   >   Two fixes for handling of hppa elf branch relocs.
> You need to explain what problem the changes are trying to fix.  Just
> assuming I understand what you're trying to do without any context is
> bad.  I might be able to guess, but I might guess wrong.  It's far better
> if you explain the problem you're trying to solve.

I thought it was clear enough from the change log, and it wasn't a case of
hitting a problem with the compiler/assembler/linker toolchain, but rather
just something I noticed looking at the code.

Here's the ChangeLog again, perhaps you didn't see it first time around:
        * elf-hppa.h (elf_hppa_final_link_relocate): Use e_rsel field
        selector for R_PARISC_PCREL17R.  R_PARISC_DIR17R and
        R_PARISC_DIR17F are for absolute branches; Handle them as such.

The first change:
"Processor-Specific ELF Supplement for PA-RISC" says
Name     Value  Instruction format     Expression
PCREL17R  11    Branch External (19)   R(symbol - PC - 8 + addend)

so if ever a R_PARISC_PCREL17R reloc is generated, it should use the R'
field selector.  I can't see how this reloc is generated, or even makes
any sort of sense in code, so this change is just for consistency.

The second change:
R_PARISC_DIR17R and R_PARISC_DIR17F are generated for instructions like

 be,n r'bar(%r1)

and all parisc branches store the displacement divided by four in the
instruction.  Without the patch, you'd get the raw displacement in the
instruction.  Also, I think absolute calls should go via a stub if they
are to a symbol in a dynamic library.

-- 
Linuxcare.  Support for the Revolution.



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