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

this will have problem ( obj->shdr = obj->symtab = obj->strtab = NULL;) #16

Open
zylinux opened this issue May 5, 2022 · 1 comment

Comments

@zylinux
Copy link

zylinux commented May 5, 2022

looks like forget initial obj->rela_text to NULL.

https://github.com/ushitora-anqou/aqcc/blob/master/ld/link.c

obj->shdr = obj->symtab = obj->strtab = NULL; -> obj->shdr = obj->symtab = obj->strtab = obj->rela_text =NULL;

    if (obj->rela_text == NULL && strcmp(name, ".rela.text") == 0) {
        obj->rela_text = offset;
        obj->nrela_text = size / 24;
    }
@ushitora-anqou
Copy link
Owner

Yeah, we need to initialize obj->rela_text here. Thanks for pointing that out. I don't have time to fix it now, but a PR is welcome.

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