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

LD discrepancy linking ASAN or UBSAN #1415

Open
poly2it opened this issue Feb 9, 2025 · 0 comments
Open

LD discrepancy linking ASAN or UBSAN #1415

poly2it opened this issue Feb 9, 2025 · 0 comments

Comments

@poly2it
Copy link

poly2it commented Feb 9, 2025

main.c

#include <stdio.h>
#include <stdint.h>


int main() {
	uint8_t data[4];

	printf("%c", data[5]);

	return 0;
}

Output:

main.o> gcc -Og -c -o main.o -std=c23 -gdwarf-4 -fno-omit-frame-pointer -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined main.c
main> gcc -Og -o main -std=c23 -gdwarf-4 -fPIC -fno-omit-frame-pointer -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined -fuse-ld=mold main.o
main: error while loading shared libraries: libasan.so.8: cannot open shared object file: No such file or directory

Without -fuse-ld=mold, this links correctly.

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

1 participant