bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/20744] New: [PPC] Incorrect relocation for VLE-instructions


From: address@hidden
Subject: [Bug gas/20744] New: [PPC] Incorrect relocation for VLE-instructions
Date: Sat, 29 Oct 2016 11:25:59 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=20744

            Bug ID: 20744
           Summary: [PPC] Incorrect relocation for VLE-instructions
           Product: binutils
           Version: 2.26
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: address@hidden
  Target Milestone: ---

According to "Power ISA Version 2.07, Book VLE, 5.9" for the VLE-instruction
"e_lis" an immediate operand is coded in bits 11..15 and 21..31 so to store it
the relocation of type 16A (R_PPC_VLE_HI16A) should be used.
But gas generates an object file which uses the relocation R_PPC_VLE_HI16D.
The bug is in "2012-05-14 James Lemke Add support for PowerPC VLE."
Variables "use_d_reloc" and "use_a_reloc" are interchanged.

The test (ppc_vle_2.s):
# powerpc64-linux-gnu-as -o ppc_vle_2.o -a32 -mvle ppc_vle_2.s
        .section        ".text"
        .align 2
        .globl func
        .type   func, @function
byte_4000D46F:
        .byte     1, 2
func:
        e_lis     7, address@hidden
        e_lbz     7, address@hidden(7)
        e_xori    0, 7, 0x80
        cntlzw    3, 0
        se_srwi   3, 5
        se_blr

The result (readelf -r ppc_vle_2.o):
Relocation section '.rela.text' at offset 0xe8 contains 2 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
00000002  000001e0 R_PPC_VLE_HA16D   00000000   .text + 0
00000008  00000104 R_PPC_ADDR16_LO   00000000   .text + 0

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]