[PATCH] D30048: Don't print DISCARD sections as gced

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 09:07:58 PST 2017


George Rimar via Phabricator <reviews at reviews.llvm.org> writes:

> grimar accepted this revision.
> grimar added a comment.
> This revision is now accepted and ready to land.
>
> LGTM with a nit, looks reasonable behavior for me.
>
> btw, currently (with or without this patch)
> we do not report sections as discarded when linkerscript is used with -gc-sections at all (when there is no /DISCARD/):

Good point. I will commit this and try to fix the linkerscipt +
gc-sections case after lunch.

> ================
> Comment at: test/ELF/linkerscript/discard-print-gc.s:4
> +# RUN: llvm-mc -triple x86_64-pc-linux %s -o %t.o -filetype=obj
> +# RUN: ld.lld -o %t.so --gc-sections %t.o --print-gc-sections -shared 2>&1 | \
> +# RUN:   FileCheck -check-prefix=CHECK %s
> ----------------
> Do you need -shared ? We link fine when do not have _start I think, if that was the case.

I normally avoid it as it causes a warning and the code is simpler with
-shared anyway.

Cheers,
Rafael


More information about the llvm-commits mailing list