bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/10558] New: gas emits invalid reloc which causes ld to abort


From: matt at NetBSD dot org
Subject: [Bug gas/10558] New: gas emits invalid reloc which causes ld to abort
Date: 25 Aug 2009 06:39:34 -0000

The follow mips asm fragment when assembled and link -shared the following 
error messages from ld:

mips64el--netbsd-as -KPIC -mabi=new -o devname.so devname.o
mips64el--netbsd-ld: error: /tmp/devname.so contains a reloc 
(0x0000000000000914) for section 
.text that references a non-existent global symbol
mips64el--netbsd-ld: final link failed: Bad value

        .file   1 "devname.c"
        .section .mdebug.abiN32
        .previous
        .abicalls
        
        addiu   $sp,$sp,-16
        move    $12,$28
        lui     $28,%hi(%neg(%gp_rel(_devname)))
        addu    $28,$28,$25
        addiu   $28,$28,%lo(%neg(%gp_rel(_devname)))
        lw      $2,%got_page($LC4+5)($28)
        addiu   $2,$2,%got_ofst($LC4+5)
        move    $28,$12
        j       $31
        addiu   $sp,$sp,16

        .set    macro
        .set    reorder
        .end    _devname
        .size   _devname, .-_devname

However, if the follow diff is applied then the error goes away.

@@ -25,8 +25,9 @@
        lui     $28,%hi(%neg(%gp_rel(_devname)))
        addu    $28,$28,$25
        addiu   $28,$28,%lo(%neg(%gp_rel(_devname)))
-       lw      $2,%got_page($LC4+5)($28)
-       addiu   $2,$2,%got_ofst($LC4+5)
+$LC5=$LC4+5
+       lw      $2,%got_page($LC5)($28)
+       addiu   $2,$2,%got_ofst($LC5)
        move    $28,$12
        j       $31
        addiu   $sp,$sp,16

Obviously that change should not caused anything to change but it did.  It 
seems that when the reloc is 
emitted, the $LC4 + 5 should have been changed to .rodata.str1.8 + offset($LC4) 
+ 5.  This bug exists 
in 2.16 and in 2.19 and on HEAD.

-- 
           Summary: gas emits invalid reloc which causes ld to abort
           Product: binutils
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: matt at NetBSD dot org
                CC: bug-binutils at gnu dot org
 GCC build triplet: x86_64--netbsd
  GCC host triplet: x86_64--netbsd
GCC target triplet: mips64el--netbsd


http://sourceware.org/bugzilla/show_bug.cgi?id=10558

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

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