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

            Bug ID: 49693
           Summary: GOT references generated for code that requests static
                    relocation model
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

; RUN: llc --relocation-model=static -mtriple=aarch64-none < %s
; RUN: llc --relocation-model=static -mtriple=x86_64-none < %s
define void @peach() unnamed_addr {
start:
  br label %bb1

bb1:                                              ; preds = %bb1, %start
  %0 = load volatile i8, i8* bitcast (void ()* @banana to i8*), align 1
  br label %bb1
}

declare void @banana() unnamed_addr

The following example generates GOT references in LLVM 12, but did not do so in
LLVM 11.

If the `@banana` is marked as `dso_local`, then a local reference is generated,
however my understanding is that the `dso_local` annotation is a hint that the
compiler is allowed to generate direct references and not that its absence
requires it to produce GOT references.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to