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

Undefined reference when linking shared libraries not raised #1313

Closed
mattparks opened this issue Jul 20, 2024 · 1 comment
Closed

Undefined reference when linking shared libraries not raised #1313

mattparks opened this issue Jul 20, 2024 · 1 comment

Comments

@mattparks
Copy link

I have an example where two shared libraries (A and B) don't link with -z defs; and where C does build with -z defs and links both libraries.
This example includes an mistake where B attempts to use a local from A (helper_a()). When linking with ld an undefined reference error is raised. This does not occur with Mold with the same linker flags, transforming this mistake into a runtime error.

If helper_a() were not defined in A at all, there is still no error raised with Mold, I don't think symbol visibility matters in this example.

I tested with mold 2.32.1, attached is the described example project:
mold_vs_ld_undefined_symbols.zip

@rui314 rui314 closed this as completed in 3001f02 Jul 21, 2024
@rui314
Copy link
Owner

rui314 commented Jul 21, 2024

Please try again with the above change.

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

No branches or pull requests

2 participants