Fixes PR 50473.
The test case uses llvm-dwarfdump to verify correct resolution.
Differential D105214
[ARM] RELA relocations for 32bit ARM ignore the addend. wolfgangp on Jun 30 2021, 11:02 AM. Authored by
Details
Fixes PR 50473. The test case uses llvm-dwarfdump to verify correct resolution.
Diff Detail Event Timeline
Comment Actions I've not seen SHT_RELA used for debug data before and I think all of the other LLVM tools assume SHT_REL. Are you planning to add SHT_RELA support to the other LLVM tools?
Comment Actions We have at least one internal test case generated by a proprietary ARM compiler that is using RELA relocations, which is handled just fine by dwarfdump (David Anderson's dwarfdump, that is), so there is some incentive for us to handle it. Also, the code I'm planning to change is used by all llvm tools, so all tools should benefit. From what I'm seeing there is SHT_RELA awareness in the other tools as well.
Comment Actions Ignore LocData for RELA relocations except for RISCV, which uses both LocData and Addend. Updated the test case by adding non-zero data to the location to verify it is ignored. Comment Actions Ping. Any comments on this more RISCV-specific approach?
Comment Actions I am fine with this patch, but want to hear from @peter.smith. I added @Higuoxing who may comment on the yaml2obj test. Comment Actions Addressed the review comments:
|
The code is written in the assumption that targets preferring RELA always have Addend while targets preferring REL always have LocData.
Are you trying to add RELA support to ARM? I think it is unpopular but maybe you have specific needs which are not specified.
No objection, but a comment is needed.