[PATCH] D97660: [llvm-objcopy][test] Improve many-sections object and test case

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 00:58:18 PST 2021


jhenderson created this revision.
jhenderson added reviewers: MaskRay, grimar, rupprecht, alexshap.
Herald added subscribers: abrachet, emaste.
jhenderson requested review of this revision.
Herald added a project: LLVM.

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).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97660

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97660.327038.patch
Type: text/x-patch
Size: 8364 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210301/7c4d5914/attachment.bin>


More information about the llvm-commits mailing list