[llvm] r249083 - [PATCH] D13360: [llvm-objdump] Teach -d about AArch64 mapping symbols

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 05:32:09 PDT 2015


>      // Sort the symbols by address, just in case they didn't come in that way.
>      array_pod_sort(Symbols.begin(), Symbols.end());
> +    std::sort(DataMappingSymsAddr.begin(), DataMappingSymsAddr.end());
> +    std::sort(TextMappingSymsAddr.begin(), TextMappingSymsAddr.end());

Why not array_pod_sort?

>      // Make a list of all the relocations for this section.
>      std::vector<RelocationRef> Rels;
> @@ -998,6 +1008,45 @@ static void DisassembleObject(const Obje
>        for (Index = Start; Index < End; Index += Size) {
>          MCInst Inst;
>
> +        // AArch64 ELF binaries can interleave data and text in the
> +        // same section. We rely on the markers introduced to
> +        // understand what we need to dump.
> +        if (Obj->isELF() && Obj->getArch() == Triple::aarch64) {

You can remove this if, no? If this is not AArch64 DataMappingSymsAddr is empty.

Also, why do you need the extra vectors? Symbols itself contains the
$d and $x symbols, no?

Cheers,
Rafael


More information about the llvm-commits mailing list