send2vinnie / mclinker

Automatically exported from code.google.com/p/mclinker
Other
0 stars 0 forks source link

instruction relaxing also need to update addend #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
So far, MCLinker updates relocation's addend while scanRelocation(). Target 
*GNULDBackend::updateAddend will update SECTION SYMBOL's addend by adding the 
output offset of the symbol's fragment.

Questions:
1. Since scanRelocation() is executed before layout() and after sectionMerge(), 
Layout.getOutputOffset(*pInputSym.fragRef()) returns the related section 
offset, not absolute file offset. Is this a correct behavior?

Problem:
2. instruction relaxing will change the value of fragment offset. Therefore, we 
should also update addend since the offset is changed.

Original issue reported on code.google.com by LubaTang on 12 Oct 2012 at 7:29

GoogleCodeExporter commented 9 years ago
Q1: yes. Here we need the *section offset* to update relocation target to the 
new offset after section merge.

Q2: I'm not sure why didn't we meet this problem... I'll check this.

Original comment by mysekki on 12 Oct 2012 at 12:52

GoogleCodeExporter commented 9 years ago

Original comment by pete.c...@gmail.com on 30 Sep 2013 at 2:23