mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-08 08:40:08 +08:00
Update bind problem macho
Changed -1 into -2 for plt_offset,
This commit is contained in:
parent
da0cc61794
commit
03841b6f16
@ -711,7 +711,7 @@ static void check_relocs(TCCState *s1, struct macho *mo)
|
|||||||
&& type == R_AARCH64_ADR_GOT_PAGE
|
&& type == R_AARCH64_ADR_GOT_PAGE
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
attr->plt_offset = -mo->n_bind_rebase - 1;
|
attr->plt_offset = -mo->n_bind_rebase - 2;
|
||||||
bind_rebase_add(mo, 1, s1->got->reloc->sh_info, &save_rel, attr);
|
bind_rebase_add(mo, 1, s1->got->reloc->sh_info, &save_rel, attr);
|
||||||
s1->got->reloc->data_offset -= sizeof (ElfW_Rel);
|
s1->got->reloc->data_offset -= sizeof (ElfW_Rel);
|
||||||
}
|
}
|
||||||
@ -722,7 +722,7 @@ static void check_relocs(TCCState *s1, struct macho *mo)
|
|||||||
if (for_code && sym->st_shndx == SHN_UNDEF) {
|
if (for_code && sym->st_shndx == SHN_UNDEF) {
|
||||||
if ((int)attr->plt_offset < -1) {
|
if ((int)attr->plt_offset < -1) {
|
||||||
/* remove above bind and replace with plt */
|
/* remove above bind and replace with plt */
|
||||||
mo->bind_rebase[-attr->plt_offset - 1].bind = 2;
|
mo->bind_rebase[-attr->plt_offset - 2].bind = 2;
|
||||||
attr->plt_offset = -1;
|
attr->plt_offset = -1;
|
||||||
}
|
}
|
||||||
if (attr->plt_offset == -1) {
|
if (attr->plt_offset == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user