Details
Diff Detail
Event Timeline
COFF/Chunks.cpp | ||
---|---|---|
226–230 | Ok, will do | |
233 | When using these relocations, you'd normally use them in a pair with SECREL_HIGH12A plus SECREL_LOW12A/L. It's very much expected and ok that the actual section relative offset is larger than 12 bits, and only the truncated lower 12 bits go with the LOW12A/L relocations. For the HIGH12A relocation, there's no corresponding larger relocation that could be used to handle the rest, so if the code uses that relocation, and there's overflow when writing the high part of it, we have an issue. Another way of writing the same would be to always check if the section relative offset is over 24 bits, regardless of which of these relocations are used. |
LGTM
Hmm, factoring that common part out doesn't seem good as I anticipated. Free free to revert it and submit. I'll try to make some cleanup on that code if possible.
You should factor out this part of code.