summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/hidden-vis-3.ll
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-01-17 19:19:55 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-01-17 19:19:55 +0000
commitd7008692355f5029ffc6360d25574e65613d63af (patch)
tree40146b40e778d6de16c1718d88ffe7556c4750bb /llvm/test/CodeGen/X86/hidden-vis-3.ll
parentbbcaf4ac5caadf71593cdd1bee8d0697ac190aaf (diff)
downloadbcm5719-llvm-d7008692355f5029ffc6360d25574e65613d63af.tar.gz
bcm5719-llvm-d7008692355f5029ffc6360d25574e65613d63af.zip
Use a got to access a hidden weak undefined on MachO.
Trying to link __attribute__((weak, visibility("hidden"))) extern int foo; int *main(void) { return &foo; } on OS X fails with ld: 32-bit RIP relative reference out of range (-4294971318 max is +/-2GB): from _main (0x100000FAB) to _foo@0x00001000 (0x00000000) in '_main' from test.o for architecture x86_64 The problem being that 0 cannot be computed as a fixed difference from %rip. Exactly the same issue exists on ELF and we can use the same solution. llvm-svn: 322739
Diffstat (limited to 'llvm/test/CodeGen/X86/hidden-vis-3.ll')
-rw-r--r--llvm/test/CodeGen/X86/hidden-vis-3.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/X86/hidden-vis-3.ll b/llvm/test/CodeGen/X86/hidden-vis-3.ll
index 5d9ef44a4d4..3137b936f5b 100644
--- a/llvm/test/CodeGen/X86/hidden-vis-3.ll
+++ b/llvm/test/CodeGen/X86/hidden-vis-3.ll
@@ -10,7 +10,7 @@ entry:
; X32: movl _y, %eax
; X64: _t:
-; X64: movl _y(%rip), %eax
+; X64: movq _y@GOTPCREL(%rip), %rax
%0 = load i32, i32* @x, align 4 ; <i32> [#uses=1]
%1 = load i32, i32* @y, align 4 ; <i32> [#uses=1]
OpenPOWER on IntegriCloud