[PATCH] Fix MCDataAtom never calling remap when adding data.
Stephen Checkoway
s at pahtak.org
Wed Oct 16 10:14:40 PDT 2013
On Oct 16, 2013, at 11:03 AM, Rafael EspĂndola <rafael.espindola at gmail.com> wrote:
>> I think you're right. What do you think the correct behavior here should be? I can think of a few possibilities:
>>
>> 1. Truncate the text atom after the last valid instruction and add a data atom for the remainder of the section.
>> 2. Truncate the text atom, add a data atom of size 1, and attempt to disassemble starting with the next byte, creating a new text atom if it succeeds.
>
> Looks like this is what it is trying to do. It should probably be
> creating the data atom with a size of 1. If disassembly flails again
> in the next byte, addData (after your patch) will correctly add the
> second byte to the atom.
I've attached a patch to do this and updated a test to check that it's correctly producing a text atom following the data atom. Would you like this as a combined patch?
There's also an issue with llvm-objdump -d not displaying data and instead giving a warning and skipping the bytes, but I'll prepare a separate patch for that.
If these look good, will you commit them for me, I don't have access.
Thanks,
--
Stephen Checkoway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MCObjectDisassembler-data-in-text.diff
Type: application/octet-stream
Size: 1654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131016/59fdaf2f/attachment.obj>
-------------- next part --------------
More information about the llvm-commits
mailing list