This is alternative solution to fix PR28976.
Problem is that in scanRelocs, we computed relocation offset too early for case when linkerscript was used.
Patch fixes the issue delaying the calculation.
Testcase is provided.
Differential D23655
[ELF] - Fix for PR28976 - Corrupted section contents when using linker scripts grimar on Aug 18 2016, 5:26 AM. Authored by
Details
This is alternative solution to fix PR28976. Problem is that in scanRelocs, we computed relocation offset too early for case when linkerscript was used. Testcase is provided.
Diff Detail Event Timeline
|
This seems a cool fix, but is it safe? Specifically, my concern is on this line.
We used to call getOffset only in the following path. If PieceI != PieceE, getOffset was not called. Now you call getOffset on both paths. Didn't change the behavior?