i tried many times to assemble and link my file code.s
, assemble went successfully but linking always failing with the following error
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in _main from code.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
final section layout:
__TEXT/__text addr=0x100003FB3, size=0x00000005, fileOffset=0x00003FB3, type=1
__TEXT/__unwind_info addr=0x100003FB8, size=0x00000048, fileOffset=0x00003FB8, type=22
__DATA/__data addr=0x100004000, size=0x00000012, fileOffset=0x00004000, type=0
ld: 32-bit absolute address out of range (0x100004000 max is 4GB): from _main + 0x00000001 (0x100003FB3) to number (0x100004000) in '_main' from code.o for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
assemble using gcc -c code.s
linking using gcc code.o -o code
the file code.s contents
.data
number: .float 89.45
sentence: .ascii "this is string"
.text
.globl _main
_main:
movl $number,%eax
any suggestions please on how to solve this issue