[all-commits] [llvm/llvm-project] 49c91a: [llvm-objcopy][test] Improve many-sections object ...

James Henderson via All-commits all-commits at lists.llvm.org
Thu Mar 4 01:45:02 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 49c91a64fd375574970ed5d8c926f71425d18d76
      https://github.com/llvm/llvm-project/commit/49c91a64fd375574970ed5d8c926f71425d18d76
  Author: James Henderson <james.henderson at sony.com>
  Date:   2021-03-04 (Thu, 04 Mar 2021)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/Inputs/many-sections.o.gz
    M llvm/test/tools/llvm-objcopy/ELF/auto-remove-shndx.test
    M llvm/test/tools/llvm-objcopy/ELF/many-sections.test
    M llvm/test/tools/llvm-objcopy/ELF/strict-no-add.test

  Log Message:
  -----------
  [llvm-objcopy][test] Improve many-sections object and test case

Additionally do some test tidy-ups and improve coverage of symbol
section indexes where the logical section index >= SHN_LORESERVE.

The symbol and section names in the many-section input object were
mostly shared. This patch changes them to be distinct, enabling
different operations such as --add-symbol, to be more targeted, when
using the object. It also makes the test less confusing and removes some
oddness in the symbol table order, presumably caused by the duplicate
names.

The input object was built from assembly that was of the form:
.section s1
sym1:
.section s2
sym2:
...
with a total of 65536 such occurrences. llvm-objcopy was then used to
remove the empty .text section automatically generated by MC, and
incidentally to move .strtab to the end of the object. This ensured that
the section/symbol indexes matched their name (i.e. section index 1 was
s1, section index 2 was s2 etc, and sym1 was in s1, sym2 in s2 etc).

Reviewed by: MaskRay

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




More information about the All-commits mailing list