[Top][All Lists]

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

[Bug ld/21516] New: PPC VLE linker produces broken object

From: alfedotov at gmail dot com
Subject: [Bug ld/21516] New: PPC VLE linker produces broken object
Date: Wed, 24 May 2017 15:53:05 +0000


            Bug ID: 21516
           Summary: PPC VLE linker produces broken object
           Product: binutils
           Version: 2.25
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: alfedotov at gmail dot com
  Target Milestone: ---

Created attachment 10067
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10067&action=edit
reproducible test case

It seems since from 2.25 version linker does something with VLE relocations
wrong. Issue not present on 2.24.90.

Running LD with certain command line and disassemble resulting ELF gives:

02000000 <__init>:
 2000000:       18 21 06 f0     e_stwu  r1,-16(r1)
 2000004:       00 80           se_mflr r0
 2000006:       54 01 00 14     e_stw   r0,20(r1)
 200000a:       00 00           se_illegal
 200000c:       50 01 00 14     e_lwz   r0,20(r1)
 2000010:       00 90           se_mtlr r0
 2000012:       20 f1           se_addi r1,16
 2000014:       00 04           se_blr
 2000016:       50 01 81 00     e_lwz   r0,0(r1)

se_illegal instruction appears in ELF multiple times and breaks runtime

Tracked down differences 2.24.90 vs 2.25 I found that check "branch in range"
at ppc_elf_relax_section() somehow affects final result. E.g. 2.24.90 produces
warning on output:
test.o: In function `main':
test.c:(.text+0x10): relocation truncated to fit: R_PPC_VLE_REL24 against
symbol `foo' defined in .ram_code section in test.o

while 2.25 is not.

Attached ld_se_illegal.tar which contains objects and linker script.

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]