This is an archive of the discontinued LLVM Phabricator instance.

[LLD] Improve --strip-all help text
ClosedPublic

Authored by bd1976llvm on May 5 2021, 3:52 AM.

Details

Summary

This is a slight improvement to the help text, as I was slightly surprised when --strip-all did more than remove the symbol table.

Currently, we match gold's help text for --strip-all and --strip-debug. I think that the GNU documentation for these options is not particularly clear. However, I have opted to make only a minor change here and keep the help text similar to gold's as these are mature options that are well understood.

Diff Detail

Event Timeline

bd1976llvm created this revision.May 5 2021, 3:52 AM
bd1976llvm requested review of this revision.May 5 2021, 3:52 AM
peter.smith accepted this revision.May 5 2021, 5:42 AM

LGTM. Will be worth waiting before committing to see if there are any comments from MaskRay.

ld.bfd (https://sourceware.org/binutils/docs/ld/Options.html) has a similar implication although it defines strip-debug as a subset of strip-all.

This revision is now accepted and ready to land.May 5 2021, 5:42 AM

Just remembered; worth making the same change in the man page in docs/ld.lld.1 as well.

bd1976llvm updated this revision to Diff 343048.EditedMay 5 2021, 7:58 AM

Thanks @peter.smith. I have added the man page update.

ld.bfd (https://sourceware.org/binutils/docs/ld/Options.html) has a similar implication although it defines strip-debug as a subset of strip-all.

I think this is the wrong way round as you have to read both the --strip-debug and the --strip-all help text to understand the behaviour of --strip-all, and the --strip-all help text doesn't indicate that he --strip-debug help text is related. I think what I have proposed in this review is better.

emaste added inline comments.May 5 2021, 10:03 AM
lld/docs/ld.lld.1
505–507

FWIW mandoc style (from FreeBSD where this originated) is to start a new sentence on a new line. Not critical, but the rest of this file follows the convention.

MaskRay accepted this revision.May 5 2021, 10:16 AM

Looks great!

Conform to mandoc style.

bd1976llvm marked an inline comment as done.May 5 2021, 10:48 AM
bd1976llvm added inline comments.
lld/docs/ld.lld.1
505–507

Thanks :)

Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2021, 4:34 AM
bd1976llvm marked an inline comment as done.May 6 2021, 4:40 AM
bd1976llvm added a subscriber: tstellar.

@tstellar this is a very safe change and we did have a customer confused by this option. Would it be possible to put this change onto the 12 release branch? Thanks.

Can you file a bug for this?

Can you file a bug for this?

https://bugs.llvm.org/show_bug.cgi?id=50264.. I have messaged you about putting this onto the release branch on that bug.

@tstellar sorry to be a pain but could you give a go or no-go for putting this on the release branch please? For internal reasons I have to finish LLVM 12 changes this week. Thanks!