[PATCH] Improve big-endian support for ARM and AArch64

Charlie Turner charlie.turner at arm.com
Tue Sep 23 09:57:50 PDT 2014


Hi,

The attached patches improve endianness support for ARM and AArch64 by

    * Fixing a segmentation fault when running llvm-dwarfdump on big-endian
ARM and AArch64 object files generated with -g -mbig-endian.
    * Reporting the detected endianness in the output of llvm-dwarfdump and
llvm-objdump for ARM and AArch64 object files (this is useful for targets
where the endianness can be big or little).

Furthermore, a refactoring has been carried out in the RelocVisitor::visit
method as used by DWARFContext. This method was relying on an arbitrary
string returned by ObjectFile::getFileFormat to determine the object word
size and target type.  Instead of checking a string, the method now switches
on the detected target triple of the object file. The string no longer needs
to encode whether the ELF file is 32 or 64-bit, since instead of the string
returned from getFileFormat being the only thing RelocVisitor knows about,
RelocVisitor now has a reference to the object it is visiting and can figure
out the word size using ObjectFile::getBytesInAddress.

Please find the patches attached.

Thanks,
Charlie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Refactor-the-RelocVisitor-visit-method.patch
Type: application/octet-stream
Size: 11062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140923/5675fb8f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-support-for-AArch64-BE-object-files.patch
Type: application/octet-stream
Size: 4750 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140923/5675fb8f/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Report-endianness-in-output-of-dwarf-obj-dump.patch
Type: application/octet-stream
Size: 5588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140923/5675fb8f/attachment-0002.obj>


More information about the llvm-commits mailing list