[llvm-bugs] [Bug 28229] New: Consider using movw/movt for local symbols in position independent code on ELF

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 21 06:28:27 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28229

            Bug ID: 28229
           Summary: Consider using movw/movt for local symbols in position
                    independent code on ELF
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: ARM
          Assignee: unassignedbugs at nondot.org
          Reporter: rafael.espindola at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Given

@a = hidden global i32 42
define i32* @f()  {
  ret i32* @a
}

llc produces

        movw    r0, :lower16:(_a-(LPC0_0+8))
        movt    r0, :upper16:(_a-(LPC0_0+8))
LPC0_0:
        add     r0, pc, r0

When targeting MachO but


        ldr     r0, .LCPI0_0
.LPC0_0:
        add     r0, pc, r0
...

.LCPI0_0:
        .long   a-(.LPC0_0+8)

When targeting ELF.

ELF has PREL relocations for MOVW/MOVT, so it should be possible to use
movw/movt on ELF too.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160621/7ae2d151/attachment.html>


More information about the llvm-bugs mailing list