[PATCH] D96292: [llvm-objcopy] Drop S_ISUID and S_ISGID bits

Manoj Gupta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 08:34:40 PST 2021


manojgupta added a comment.

In D96292#2563966 <https://reviews.llvm.org/D96292#2563966>, @MaskRay wrote:

> In D96292#2549683 <https://reviews.llvm.org/D96292#2549683>, @manojgupta wrote:
>
>> This change make further deviation from GNU tools. Lets wait for resolution of D93881 <https://reviews.llvm.org/D93881>. This will not be needed if D93881 <https://reviews.llvm.org/D93881> is merged.
>
> This change actually makes our behavior consistent with current GNU strip/objcopy. GNU strip/objcopy does not copy S_ISUID and S_ISGID bits.
>
>   chmod u+s,g+s,o+x a
>   sudo llvm-strip a -o b
>
> Currently `b` has S_ISUID and S_ISGID bits.

Thanks @MaskRay  for the example.
I agree that for the case of Output != Input, S_ISUID and S_ISGID bits should not be copied. The bits should be kept only when Output == Input .


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96292/new/

https://reviews.llvm.org/D96292



More information about the llvm-commits mailing list