Skip to content

[LLD][ARM] Link fails when using -frwpi and debug symbolsΒ #89197

@hpfaz

Description

@hpfaz

Tested from clang-16 to clang-18 (x86-64) cross-compiling to arm-none-eabi, please refer to https://godbolt.org/z/GEf89sqs3

test code is:

int val = 42;

int test(int num) {
    return val * num;
}

Clang command line is:
--target=arm-none-none-eabi -g -O0 -frwpi -v -nostdlib

LLD fails with:
ld.lld: error: /tmp/example-5528f7.o:(.debug_info+0x33): has non-ABS relocation R_ARM_SBREL32 against symbol 'val'

Using -g0 instead of -g will link as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions