[PATCH] D43069: [ELF] - Report error if removed empty output section used undefined symbols.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 08:16:44 PST 2018


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

> grimar updated this revision to Diff 133420.
> grimar edited the summary of this revision.
> grimar added a comment.
>
> - Simplified implementation, added missing testcases.
>
>
> https://reviews.llvm.org/D43069
>
> Files:
>   ELF/LinkerScript.cpp
>   test/ELF/linkerscript/address-expr-symbols.s
>
>
> Index: test/ELF/linkerscript/address-expr-symbols.s
> ===================================================================
> --- test/ELF/linkerscript/address-expr-symbols.s
> +++ test/ELF/linkerscript/address-expr-symbols.s
> @@ -0,0 +1,15 @@
> +# REQUIRES: x86
> +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
> +# RUN: echo "SECTIONS { .bar (a+b) : AT(d) ALIGN(c) { } };" > %t.script


This would already work if there was an input .bar section, no?
How about changing isAllSectionDescription so that we mark as live any
"fancy" section. That is, any section that specifies an address,
physical address or alignment.

That seems in line with lld keeping more sections than bfd. It should
not pollute the output too much as I think those constructs are not that
common.

Cheers,
Rafael


More information about the llvm-commits mailing list