bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/17505] New: arm: bad static label resolution from different mode


From: chrbr at gcc dot gnu.org
Subject: [Bug ld/17505] New: arm: bad static label resolution from different modes
Date: Thu, 23 Oct 2014 12:28:16 +0000

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



            Bug ID: 17505

           Summary: arm: bad static label resolution from different modes

           Product: binutils

           Version: 2.24

            Status: NEW

          Severity: normal

          Priority: P2

         Component: ld

          Assignee: unassigned at sourceware dot org

          Reporter: chrbr at gcc dot gnu.org



Created attachment 7843

  --> https://sourceware.org/bugzilla/attachment.cgi?id=7843&action=edit

test to reproduce



While working on the attribute_target GCC attribute, I find myself calling a

static THUMB function while in ARM mode, or vice versa.



(this works fine when functions are .global)



Using the attached .s example, with 

foo:



    .thumb_func

    .type    bar, %function





 the relocations are in the object



00000000 <main>:

 00000000 <main>:

   0:    ebfffffe     bl    0 <main>

            0: R_ARM_CALL    foo

   4:    ebfffffe     bl    0 <main>

            4: R_ARM_CALL    bar



is resolved in the final binary as:



Disassembly of section .text:



00008018 <main>:

    8018:    eb000085     bl    8234 <bar>

    801c:    fa000084     blx    8234 <bar>



instead of bl <foo>



What is surprising is that the linker correctly patches the BL/BLX

instructions, itś just the address that is wrong. I´m wondering i
f this can be

fixed in the linker machinery to handle interwork or have the assembly emit
 a

R_ARM_THM_CALL reloc 



assembled/linked with :



arm-none-eabi-gcc  1.s -o 1.u



-- 

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]