44 lines · plain
1# REQUIRES: x862 3# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o4 5# RUN: echo "ENTRY(_label)" > %t.script6# RUN: ld.lld %t.script %t.o -o %t7# RUN: llvm-readelf -hs %t | FileCheck %s8 9# RUN: echo 'ENTRY("_label")' > %t.script10# RUN: ld.lld %t.script %t.o -o %t11# RUN: llvm-readelf -hs %t | FileCheck %s12 13# CHECK: Entry point address: 0x[[#%x,ENTRY:]]14# CHECK: [[#]]: {{0*}}[[#ENTRY]] 0 NOTYPE GLOBAL DEFAULT [[#]] _label15 16## -e overrides the ENTRY command.17# RUN: echo "ENTRY(_label)" > %t.script18# RUN: ld.lld -e _start -o %t2 %t.script %t.o19# RUN: llvm-readobj --file-headers --symbols %t2 | \20# RUN: FileCheck -check-prefix=OVERLOAD %s21 22# OVERLOAD: Entry: [[ENTRY:0x[0-9A-F]+]]23# OVERLOAD: Name: _start24# OVERLOAD-NEXT: Value: [[ENTRY]]25 26## The entry symbol can be a linker-script-defined symbol.27# RUN: echo "ENTRY(foo); foo = 1;" > %t.script28# RUN: ld.lld -o %t %t.script %t.o29# RUN: llvm-readobj --file-headers --symbols %t | FileCheck --check-prefix=SCRIPT %s30 31# SCRIPT: Entry: 0x132 33## An undefined entry symbol causes a warning.34# RUN: echo "ENTRY(no_such_symbol);" > %t.script35# RUN: ld.lld %t.script %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=MISSING %s36 37# MISSING: warning: cannot find entry symbol no_such_symbol38 39.globl _start, _label40_start:41 ret42_label:43 ret44