sba1 / adtools

Experimental GNU toolchain for AmigaOS
31 stars 18 forks source link

Don't emit dynamic relocations for data symbols #101

Closed lephilousophe closed 3 years ago

lephilousophe commented 3 years ago

This is a fix for #77. More explanations are in the issue.

Basically, R_PPC_ADDR32 relocations are not supported on AmigaOS when resolving dynamic symbols.

sba1 commented 3 years ago

Thanks! Can you please add your findings/reasons in the commit message of the patch? That way everything is self-contained within the patch.

lephilousophe commented 3 years ago

Done. I tried to keep commit message generic and not too focused on the original issue.

sba1 commented 3 years ago

Okay, I'll take this. I will update the patch description with your findings.

sba1 commented 3 years ago

I updated the decription. Please have a look at whether I interpretet it correctly. See https://github.com/sba1/adtools/commit/dba0f7aaac9520f8e4896ff7a384a00b03e02f87

Also, I'm wondering if elf.library really cannot handle the R_PPC_ADDR32 relocations when using dynamic loading. Perhaps the generated ones are only wrong? How much reserach did you spent on it?

Anyway, it would be great to have an automated test case here to avoid the bug for furture binutils updates.

lephilousophe commented 3 years ago

Sorry I read your message too fast and missed a word. I thought you meant the commit instead of the patch inside the commit. Message looks great.

I spent the time needed to understand that these relocations were not resolved at runtime. That's all.

Please note that the comment in GNU ld, above the block I modified, explicitly mentions that VxWorks doesn't support R_PPC_ADDR32 with dynamic symbols either. It was enough for me to not look more. In addition, I don't have any AmigaOS machine and elf.library is closed source... It's not easy for me to debug this.

If someone with the hardware and able to play with relocations wants to do more tests, I can help. Another solution would be to seek support to Hyperion. I really don't know how it works.