Skip to content

[flang] Unexpected relocation R_AARCH64_MOVW_UABS_G0_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC #144288

Open
@sscalpone

Description

@sscalpone

Messages when linking a fujitsu tests with some fairly large arrays. Note also that the linker gives some advice (to use -fPIC) that is rejected by flang (as expected).

% flang -mcmodel=large -fno-automatic -fno-pic 1033/1033_0141.f90
/opt/binutils/latest/bin/ld: /tmp/1033_0141-772b19.o: relocation R_AARCH64_MOVW_UABS_G0_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
/tmp/1033_0141-772b19.o: in function `s_':
FIRModule:(.text+0x110): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against symbol `_QQclXfd320d1fece8bb221c1c7d495e881010' defined in .rodata._QQclXfd320d1fece8bb221c1c7d495e881010[_QQclXfd320d1fece8bb221c1c7d495e881010] section in /tmp/1033_0141-772b19.o
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
FIRModule:(.text+0x390): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against symbol `_QQclXfd320d1fece8bb221c1c7d495e881010' defined in .rodata._QQclXfd320d1fece8bb221c1c7d495e881010[_QQclXfd320d1fece8bb221c1c7d495e881010] section in /tmp/1033_0141-772b19.o
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
/tmp/1033_0141-772b19.o: in function `t_':
FIRModule:(.text+0x4c8): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against symbol `_QQclXfd320d1fece8bb221c1c7d495e881010' defined in .rodata._QQclXfd320d1fece8bb221c1c7d495e881010[_QQclXfd320d1fece8bb221c1c7d495e881010] section in /tmp/1033_0141-772b19.o
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
FIRModule:(.text+0x4dc): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against symbol `_QQclX6572726F72' defined in .rodata._QQclX6572726F72[_QQclX6572726F72] section in /tmp/1033_0141-772b19.o
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
FIRModule:(.text+0x510): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against symbol `_QQclXfd320d1fece8bb221c1c7d495e881010' defined in .rodata._QQclXfd320d1fece8bb221c1c7d495e881010[_QQclXfd320d1fece8bb221c1c7d495e881010] section in /tmp/1033_0141-772b19.o
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
/opt/binutils/latest/bin/ld: BFD (GNU Binutils) 2.43 assertion fail elfnn-aarch64.c:5074
FIRModule:(.text+0x524): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against symbol `_QQclX70617373' defined in .rodata._QQclX70617373[_QQclX70617373] section in /tmp/1033_0141-772b19.o
flang-21: error: linker command failed with exit code 1 (use -v to see invocation)
% flang -mcmodel=large -fno-automatic -fPIC 1033/1033_0141.f90
flang-21: error: invalid argument '-mcmodel=large' only allowed with '-fno-pic'

Metadata

Metadata

Assignees

No one assigned

    Labels

    flangFlang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions