Skip to content

Commit

Permalink
Fix linux build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Sep 17, 2024
1 parent 75b71c9 commit 29985a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tccelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,11 +1049,11 @@ ST_FUNC void relocate_syms(TCCState *s1, Section *symtab, int do_resolve)
if (do_resolve) {
#if defined TCC_IS_NATIVE && !defined TCC_TARGET_PE
/* dlsym() needs the undecorated name. */
void *addr = dlsym(RTLD_SELF, &name[s1->leading_underscore]);
void *addr = dlsym(RTLD_DEFAULT, &name[s1->leading_underscore]);
#ifdef TCC_TARGET_MACHO
// System frameworks might need RTLD_DEFAULT on macOS.
if (addr == NULL) {
addr = dlsym(RTLD_DEFAULT, &name[s1->leading_underscore]);
addr = dlsym(RTLD_SELF, &name[s1->leading_underscore]);
}
#endif
#if TARGETOS_OpenBSD || TARGETOS_FreeBSD || TARGETOS_NetBSD || TARGETOS_ANDROID
Expand Down

0 comments on commit 29985a3

Please sign in to comment.