Skip to content

Conversation

@markyang92
Copy link

When using the lld linker, compilation with PIC is required. The bfd linker may allow it, but the lld linker requires recompilation with -fPIC if relocation is found in PIE.

aarch64-poky-linux-ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against symbol 'type:.eq.os.file'; recompile with -fPIC
>>> defined in /tmp/go-link-1382269313/go.o
>>> referenced by go.go
>>>               /tmp/go-link-1382269313/go.o:(.rodata+0x1750)

@markyang92 markyang92 requested a review from a team as a code owner October 20, 2025 05:36
When using the lld linker, compilation with PIC is required.
The bfd linker may allow it, but the lld linker requires recompilation with -fPIC if relocation is found in PIE.

```
aarch64-poky-linux-ld.lld: error: relocation R_AARCH64_ABS64 cannot be used against symbol 'type:.eq.os.file'; recompile with -fPIC
>>> defined in /tmp/go-link-1382269313/go.o
>>> referenced by go.go
>>>               /tmp/go-link-1382269313/go.o:(.rodata+0x1750)
```

Signed-off-by: mark.yang <[email protected]>
Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants