[all-commits] [llvm/llvm-project] 536ba6: [Object] Change ELFObjectFile<ELFT>::getFileFormat...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Mar 16 07:42:37 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 536ba6373f05fb1e9bc7199e301fbf4bc514006f
      https://github.com/llvm/llvm-project/commit/536ba6373f05fb1e9bc7199e301fbf4bc514006f
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-03-16 (Mon, 16 Mar 2020)

  Changed paths:
    M lld/test/ELF/basic-ppc.s
    M lld/test/ELF/basic-ppc64.s
    M lld/test/ELF/format-binary.test
    M lld/test/ELF/gnu-hash-table.s
    M lld/test/ELF/linkerscript/linker-script-in-search-path.s
    M lld/test/ELF/lto/lto-start.ll
    M lld/test/ELF/lto/obj-path.ll
    M lld/test/ELF/lto/thinlto-debug-fission.ll
    M lld/test/ELF/lto/thinlto-obj-path.ll
    M lld/test/ELF/relocatable-empty-archive.s
    M lld/test/ELF/relocatable.s
    M llvm/include/llvm/Object/ELFObjectFile.h
    M llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
    M llvm/test/CodeGen/AArch64/arm64-simplest-elf.ll
    M llvm/test/CodeGen/AMDGPU/elf.ll
    M llvm/test/CodeGen/AMDGPU/elf.r600.ll
    M llvm/test/DebugInfo/AArch64/big-endian-dump.ll
    M llvm/test/DebugInfo/AArch64/little-endian-dump.ll
    M llvm/test/DebugInfo/ARM/big-endian-dump.ll
    M llvm/test/DebugInfo/ARM/little-endian-dump.ll
    M llvm/test/DebugInfo/Sparc/gnu-window-save.ll
    M llvm/test/MC/ARM/dwarf-asm-no-code.s
    M llvm/test/MC/AVR/dwarf-asm-no-code.s
    M llvm/test/MC/AsmParser/non-english-characters.s
    M llvm/test/MC/ELF/empty.s
    M llvm/test/MC/ELF/relocation-386.s
    M llvm/test/MC/Hexagon/basic.ll
    M llvm/test/MC/RISCV/elf-header.s
    M llvm/test/MC/Sparc/sparc-relocations.s
    M llvm/test/Object/AMDGPU/elf32-unknown.yaml
    M llvm/test/Object/AMDGPU/elf64-unknown.yaml
    M llvm/test/Object/invalid-alignment.test
    M llvm/test/ThinLTO/X86/empty-module.ll
    M llvm/test/tools/gold/X86/thinlto.ll
    M llvm/test/tools/llvm-objcopy/ELF/binary-output-target.test
    M llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
    M llvm/test/tools/llvm-objcopy/ELF/many-sections.test
    M llvm/test/tools/llvm-readobj/ELF/all.test
    M llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-definitions.test
    M llvm/test/tools/llvm-readobj/ELF/basic.test
    M llvm/test/tools/llvm-readobj/ELF/dynamic-no-pt-dynamic.test
    M llvm/test/tools/llvm-readobj/ELF/file-headers.test
    M llvm/test/tools/llvm-readobj/ELF/loadname.test
    M llvm/test/tools/llvm-readobj/ELF/no-action.test
    M llvm/test/tools/llvm-readobj/ELF/ppc64-glink.test
    M llvm/test/tools/llvm-readobj/ELF/program-headers.test
    M llvm/test/tools/llvm-readobj/archive.test
    M llvm/test/tools/llvm-readobj/thin-archive.test

  Log Message:
  -----------
  [Object] Change ELFObjectFile<ELFT>::getFileFormatName() to use BFD names

Follow-up for D74433

What the function returns are almost standard BFD names, except that "ELF" is
in uppercase instead of lowercase.

This patch changes "ELF" to "elf" and changes ARM/AArch64 to use their BFD names.
MIPS and PPC64 have endianness differences as well, but this patch does not intend to address them.

Advantages:

* llvm-objdump: the "file format " line matches GNU objdump on ARM/AArch64 objects
* "file format " line can be extracted and fed into llvm-objcopy -O literally.
  (https://github.com/ClangBuiltLinux/linux/issues/779 has such a use case)

Affected tools: llvm-readobj, llvm-objdump, llvm-dwarfdump, MCJIT (internal implementation detail, not exposed)

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D76046




More information about the All-commits mailing list