I was confused about mixing of type names in Target and its callers for a long time.
Patch suggest the fix for that. It changes all relocations types to be uint32_t and also fixes some dependent inconsistency in callers code.
Details
Details
- Reviewers
ruiu • rafael - Commits
- rG98b060d22807: [ELF] - Use the uint32_t instead of unsigned in Target class for relocations…
rLLD262793: [ELF] - Use the uint32_t instead of unsigned in Target class for relocations…
rL262793: [ELF] - Use the uint32_t instead of unsigned in Target class for relocations…
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM with nits
The part about using uint32_t for relocation type LGTM. That is what getType in ELFTypes.h returns and we may as well just propagate it.
ELF/Target.cpp | ||
---|---|---|
885 ↗ | (On Diff #49811) | return unsigned for now. |
ELF/Target.h | ||
72 ↗ | (On Diff #49811) | I would leave this one as unsigned. Or at least do it in another patch. |
ELF/Target.cpp | ||
---|---|---|
885 ↗ | (On Diff #49811) | it is used as: void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd, RelIteratorRange<isRela> Rels) { typedef Elf_Rel_Impl<ELFT, isRela> RelType; size_t Num = Rels.end() - Rels.begin(); for (size_t I = 0; I < Num; ++I) { ... I += Target->relaxTls(BufLoc, BufEnd, Type, AddrLoc, SymVA, Body); I believe size_t is expected here. Why do you want to change that ? |
ELF/Target.h | ||
72 ↗ | (On Diff #49811) | Do you mean that I can change that to size_t but just commit separatelly ? |
Comment Actions
I meant reviewed separately, but given the use, it LGTM too. Just
commit separately.Thanks,
Rafael
Sure, I will do soon.
Thank you for review !
George