Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LLD] symbol not found with PROVIDE script #111478

Open
DianQK opened this issue Oct 8, 2024 · 2 comments
Open

[LLD] symbol not found with PROVIDE script #111478

DianQK opened this issue Oct 8, 2024 · 2 comments
Labels
lld regression:19 Regression in 19 release

Comments

@DianQK
Copy link
Member

DianQK commented Oct 8, 2024

I tried the following code. I expect lld to link successful while also removing unused symbols, but it reports symbol not found: bar.

a.s:

.global _start
_start:
 nop
.section .text.foo,"ax",@progbits
.global foo
foo:
 nop
.section .text.bar,"ax",@progbits
.global bar
bar:
 nop

script.t:

PROVIDE(foo = bar);

commands:

llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
ld.lld -o a_gc a.o --gc-sections -T script.t

output:

ld.lld: error: script.t:1: symbol not found: bar
ld.lld: error: script.t:1: symbol not found: bar
ld.lld: error: script.t:1: symbol not found: bar

cc @MaskRay ebb326a

@MaskRay
Copy link
Member

MaskRay commented Oct 9, 2024

I cannot reproduce ld.lld: error: script.t:1: symbol not found: bar. Are you testing the latest lld?

foo is not in the symbol table. lld considers it unneeded.

@DianQK
Copy link
Member Author

DianQK commented Oct 9, 2024

I cannot reproduce ld.lld: error: script.t:1: symbol not found: bar. Are you testing the latest lld?

foo is not in the symbol table. lld considers it unneeded.

Sorry, I mistakenly deleted the definition of foo. I may have forgotten to run the llvm-mc command to verify after the deletion. I have now fixed this description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lld regression:19 Regression in 19 release
Projects
Status: Needs Triage
Development

No branches or pull requests

2 participants