mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-01 04:20:09 +08:00
Fix weak support apple
This commit is contained in:
parent
e99cf72784
commit
d578151f8c
@ -1004,13 +1004,13 @@ static void do_bind_rebase(TCCState *s1, struct macho *mo)
|
|||||||
}
|
}
|
||||||
for (i = 0; i < mo->n_bind; i++) {
|
for (i = 0; i < mo->n_bind; i++) {
|
||||||
int sym_index = ELFW(R_SYM)(mo->bind[i].rel.r_info);
|
int sym_index = ELFW(R_SYM)(mo->bind[i].rel.r_info);
|
||||||
sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
|
|
||||||
Section *s = s1->sections[mo->bind[i].section];
|
Section *s = s1->sections[mo->bind[i].section];
|
||||||
Section *binding = ELFW(ST_BIND)(sym->st_info) == STB_WEAK
|
Section *binding;
|
||||||
? mo->weak_binding : mo->binding;
|
|
||||||
|
|
||||||
sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
|
sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
|
||||||
name = (char *) symtab_section->link->data + sym->st_name;
|
name = (char *) symtab_section->link->data + sym->st_name;
|
||||||
|
binding = ELFW(ST_BIND)(sym->st_info) == STB_WEAK
|
||||||
|
? mo->weak_binding : mo->binding;
|
||||||
ptr = section_ptr_add(binding, 5 + strlen(name));
|
ptr = section_ptr_add(binding, 5 + strlen(name));
|
||||||
*ptr++ = BIND_OPCODE_SET_DYLIB_SPECIAL_IMM |
|
*ptr++ = BIND_OPCODE_SET_DYLIB_SPECIAL_IMM |
|
||||||
(BIND_SPECIAL_DYLIB_FLAT_LOOKUP & 0xf);
|
(BIND_SPECIAL_DYLIB_FLAT_LOOKUP & 0xf);
|
||||||
|
Loading…
Reference in New Issue
Block a user