[llvm-dev] Clearing the BSS section

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Fri Aug 28 08:59:57 PDT 2015


On Fri, Aug 28, 2015 at 8:27 AM, Joerg Sonnenberger via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> On Fri, Aug 28, 2015 at 04:52:56PM +0200, devh8h via llvm-dev wrote:
> > Is there a way to prevent the optimizer to assume the two variables
> > are distinct ? Or what is the proper way to deal with link time values ?
>
> Make one of them weak.
>

It'd be better to make the both zero-sized, like an array of i8 with zero
elements. This idiom has come up before, and that's our recommended
solution. We've tweaked the optimizers to ensure that zero-sized objects
are not assumed to be distinct.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150828/17bd8770/attachment.html>


More information about the llvm-dev mailing list