This is an archive of the discontinued LLVM Phabricator instance.

[ifs] Add the invalid STRSZ test to llvm-ifs
ClosedPublic

Authored by haowei on Feb 14 2022, 10:49 AM.

Details

Summary

This patch adds an addition test to test llvm-ifs's behavior when DT_STRSZ value from .dynamic is invalid

Diff Detail

Event Timeline

haowei requested review of this revision.Feb 14 2022, 10:49 AM
haowei created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 10:49 AM
jhenderson added inline comments.Feb 14 2022, 11:53 PM
llvm/test/tools/llvm-ifs/binary-read-bad-vaddr.test
61

Rather than duplicating the YAML, you'd be better off using yaml2obj's -D option to parameterize the fields that vary between the two test cases. You can specify default values for fields using the variable defined by that option, so that you only need one -D per test case.

105

This is essentially identical to ERR1, but with a different value. Perhaps use FileCheck -D to parameterize the value, rather than duplicating the entire message?

haowei updated this revision to Diff 409004.Feb 15 2022, 12:20 PM

I wasn't aware yaml2obj support -D as well. Thanks for pointing it out.

This revision is now accepted and ready to land.Feb 16 2022, 12:25 AM
This revision was landed with ongoing or failed builds.Feb 16 2022, 9:58 AM
This revision was automatically updated to reflect the committed changes.