This is an archive of the discontinued LLVM Phabricator instance.

[NFCI][XCOFF][AIX] Skip empty Section during object file generation
ClosedPublic

Authored by jasonliu on Oct 25 2019, 1:13 PM.

Details

Summary

This is a fix to D69112 where we common up the logic of writing CsectGroup.
However, we forget to skip the Sections that are empty in that patch.

Diff Detail

Event Timeline

jasonliu created this revision.Oct 25 2019, 1:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 25 2019, 1:13 PM
jasonliu updated this revision to Diff 226497.Oct 25 2019, 1:58 PM
daltenty added inline comments.Oct 25 2019, 2:10 PM
llvm/lib/MC/XCOFFObjectWriter.cpp
151

Should this be uint16_t?

jasonliu updated this revision to Diff 226541.Oct 26 2019, 9:37 AM

Change SectionCount type to unsigned.

jasonliu marked an inline comment as done.Oct 26 2019, 9:43 AM
jasonliu added inline comments.
llvm/lib/MC/XCOFFObjectWriter.cpp
151

Originally choose the signed type at the mind set of "don't use unsigned to represent integer that could not be negative." And also, want this to be the same type as the Maximum section index could be.
But just find out that we are actually writing this SectionCount as unsigned in the object file. So I figure I will just avoid the controversy and use unsigned instead.
Thanks.

This revision is now accepted and ready to land.Oct 28 2019, 7:03 AM
xingxue accepted this revision.Oct 28 2019, 7:12 AM

LGTM.

This revision was automatically updated to reflect the committed changes.