This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy][test] Improve empty section tests
ClosedPublic

Authored by MaskRay on Feb 19 2020, 4:17 PM.

Details

Summary

empty-sections.test: add two tests adapted from @jhenderson's https://reviews.llvm.org/D74755#1882221
strip-non-alloc.test: improve. D74755 will change the attribution of an empty section.

They mostly test the behavior of Object.cpp:sectionWithinSegment : how we attribute sections to segments.
ParentSegment can affect some subtle layout decisions.

Diff Detail

Event Timeline

MaskRay created this revision.Feb 19 2020, 4:17 PM
grimar added inline comments.Feb 20 2020, 12:11 AM
llvm/test/tools/llvm-objcopy/ELF/empty-section.test
5

Can you add a comment here and for the test below?

71

[SHF_ALLOC] is one byte off.

MaskRay updated this revision to Diff 246077.Feb 22 2020, 8:37 AM
MaskRay marked 3 inline comments as done.

Improve tests

MaskRay updated this revision to Diff 246078.Feb 22 2020, 9:19 AM
MaskRay edited the summary of this revision. (Show Details)

Improve tests

jhenderson added inline comments.Feb 25 2020, 1:17 AM
llvm/test/tools/llvm-objcopy/ELF/empty-section.test
13

Seems to me like here and below you can get rid of the columns after Off?

39

according to the

llvm/test/tools/llvm-objcopy/ELF/strip-non-alloc.test
11–12 ↗(On Diff #246078)

Shouldn't these two be on the same line?

MaskRay updated this revision to Diff 246527.Feb 25 2020, 12:03 PM
MaskRay marked 3 inline comments as done.

Address comments

MaskRay added inline comments.Feb 25 2020, 12:07 PM
llvm/test/tools/llvm-objcopy/ELF/empty-section.test
5

The original test is not very useful. I will replace it with --docnum=2 with segments removed.

This revision is now accepted and ready to land.Feb 26 2020, 1:54 AM
This revision was automatically updated to reflect the committed changes.