This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Make sure ZeroFill sections are at the end of their segments
ClosedPublic

Authored by int3 on Jun 15 2020, 3:14 PM.

Details

Summary

ld64 does this, and references an internal rdar:// number as an explanation. No
idea what that rdar issue is, but in practice, it seems that not putting a BSS
section at the end can cause subsequent sections in the same segment to be
overwritten with zeroes.

Diff Detail

Event Timeline

int3 created this revision.Jun 15 2020, 3:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2020, 3:14 PM

This depends on D81887 right?

int3 added a comment.Jun 15 2020, 4:36 PM

Yup. Not sure why arc didn't automatically link it up...

Yup. Not sure why arc didn't automatically link it up...

AFAIK arc doesn't infer the link automatically based on your git commit stacking ... you have to set it up manually or put "Depends on Dxxxxx" in your Summary :(

int3 added a comment.Jun 15 2020, 8:13 PM

On my Mac it was somehow configured to add "Depends on Dxxxxx" automatically

compnerd accepted this revision.Jun 30 2020, 8:52 AM
This revision is now accepted and ready to land.Jun 30 2020, 8:52 AM
This revision was automatically updated to reflect the committed changes.
MaskRay added a subscriber: MaskRay.Jul 1 2020, 9:53 PM

Hi, your git commit contains extra Phabricator tags. You can drop Reviewers: Subscribers: Tags: and the text Summary: from the git commit with the following script:

arcfilter () {
        arc amend
        git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend --date=now -F -
}

Reviewed By: is considered important by some people. Please keep the tag. (--date=now is my personal preference (author dates are usually not useful. Using committer dates can make log almost monotonic in time))

llvm/utils/git/pre-push.py can validate the message does not include unneeded tags.

int3 added a comment.Jul 2 2020, 1:23 AM

Yeah sorry I keep forgetting to clean up the commit message before landing. I'll use those scripts in the future. Thanks!