This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy][test] Improve many-sections object and test case
ClosedPublic

Authored by jhenderson on Mar 1 2021, 12:58 AM.

Details

Summary

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

Diff Detail

Event Timeline

jhenderson created this revision.Mar 1 2021, 12:58 AM
jhenderson requested review of this revision.Mar 1 2021, 12:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 1 2021, 12:58 AM
MaskRay accepted this revision.Mar 1 2021, 12:46 PM

LGTM.

This revision is now accepted and ready to land.Mar 1 2021, 12:46 PM
This revision was landed with ongoing or failed builds.Mar 4 2021, 1:45 AM
This revision was automatically updated to reflect the committed changes.