Bug 383801 - The DWARF parser doesn't call the relocation code when reading a string offset.
Summary: The DWARF parser doesn't call the relocation code when reading a string offset.
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Agent (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.1   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-28 09:44 EDT by Manuel Coutand CLA
Modified: 2013-06-05 04:48 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (884 bytes, patch)
2012-06-28 09:46 EDT, Manuel Coutand CLA
mober.at+eclipse: iplog-
Details | Diff
Additional patch (4.23 KB, patch)
2012-06-28 09:52 EDT, Manuel Coutand CLA
mober.at+eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Coutand CLA 2012-06-28 09:44:21 EDT
in dio_ReadFormStringRef(), dio_ReadUX() was called rather than the function that handles the relocation ( dio_ReadAddressX() ).

In a object file, we had a DW_FORM_strp that was rellocated but parser didn't look for the relocation and found garbage data.
Comment 1 Manuel Coutand CLA 2012-06-28 09:46:46 EDT
Created attachment 218020 [details]
Proposed patch

Here is a proposed patch to use dio_ReadAddressX() instead of dio_ReadUX() in dio_ReadFormStringRef() to handle relocation.

Thanks to Xavier Pouyollon for helping me figure this out.
Comment 2 Manuel Coutand CLA 2012-06-28 09:52:05 EDT
Created attachment 218024 [details]
Additional patch

We ended up looking for other places dio_ReadUX() should be replaced by dio_ReadAddressX() to handle relocation.

0002-Fix-DWARF-reloc.patch is what we came up with.

I don't have a usecase where those uses of dio_ReadUX() caused a problem, this fix aims a fixing potential problems. I'd understand if there is some places dio_ReadUX() is mandatory for reasons I've missed.
Comment 3 Eugene Tarassov CLA 2012-06-29 15:34:15 EDT
> I don't have a usecase where those uses of dio_ReadUX() caused a problem, this
> fix aims a fixing potential problems. I'd understand if there is some places
> dio_ReadUX() is mandatory for reasons I've missed.

I think it is safe to call dio_ReadAddressX() always. At least, it does not break tests that I have.

I have committed the patches.
Thanks!
Comment 4 Eugene Tarassov CLA 2012-06-29 15:34:37 EDT
Fixed
Comment 5 Martin Oberhuber CLA 2013-05-24 17:35:34 EDT
Comment on attachment 218020 [details]
Proposed patch

iplog- since git has the author:

http://git.eclipse.org/c/tcf/org.eclipse.tcf.agent.git/commit/?id=436f4747e00e53297faf53a40bc1f81034faf709
Comment 6 Martin Oberhuber CLA 2013-05-24 17:36:04 EDT
Comment on attachment 218024 [details]
Additional patch

iplog- since git has the author:

http://git.eclipse.org/c/tcf/org.eclipse.tcf.agent.git/commit/?id=c7982cbaf27d2e58404cc5313a14665a9427a08c