1 # RUN: llvm-mc -triple=x86_64-unknown-linux-gnu -filetype=obj -o %t %s
2 # RUN: llvm-jitlink -phony-externals -noexec %t
4 # Check that symbol scope is demoted to local when external symbols are
5 # converted to absolutes. This is demotion is necessary to avoid "unexpected
8 # The reference to _GLOBAL_OFFSET_TABLE_ will trigger creation of an external
9 # _GLOBAL_OFFSET_TABLE_ symbol, and the GOTOFF relocation will force creation
10 # of a GOT symbol without actually introducing any GOT entries. Together these
11 # should cause the external _GLOBAL_OFFSET_TABLE_ symbol to be converted to an
12 # absolute symbol with address zero. If the scope is not demoted correctly this
13 # will trigger an "unexpected definition" error.
16 .file "ELF_external_to_absolute_conversion.s"
22 leaq
.L0$pb(%rip), %rax
23 movabsq $_GLOBAL_OFFSET_TABLE_-
.L0$pb, %rcx
24 movabsq $_foo@GOTOFF
, %rax