Errors in getDynRel are quite common, so it might be worth printing exact place of error.
Details
Diff Detail
Event Timeline
ELF/Relocations.cpp | ||
---|---|---|
721 | Add a blank line between code and comment. | |
723 | I think we don't put a period at end of a sentence in error messages. | |
ELF/Target.cpp | ||
697–698 | Probably unintended change. | |
738–739 | Ditto | |
820–821 | Ditto | |
838 | Ditto (and so on) | |
ELF/Target.h | ||
30–31 | The meaning of the second return value is not very clear. How about this? We can add Target::isAbsRel(uint32_t). If it returns true, we should report an error. Then I think we don't need to modify getDynRel. |
ELF/Target.h | ||
---|---|---|
30–31 | isAbsRel is a bit confusing (in position independent code RelExpr may be R_GOT_PC as well). How about isPICRel ? |
LGTM with these comments addressed.
ELF/Relocations.cpp | ||
---|---|---|
716 | We have Config->Pic, so it should be named isPicRel. | |
721 | ping | |
ELF/Target.cpp | ||
1250 | You can just return Type because R_AARCH64_ABS32 was just a dummy value to return something in an error condition. | |
1980 | Remove () after return. | |
1985 | This is I think just a dummy value, too. |
We have Config->Pic, so it should be named isPicRel.