[google/gcc-4_9] Fix static var promotion handling for LIPO

Xinliang David Li davidxl@google.com
Mon Sep 15 20:55:00 GMT 2014


ok.

David

On Mon, Sep 15, 2014 at 1:43 PM, Sharad Singhai <singhai@google.com> wrote:
> This patch is for the google/gcc-4_9 branch to fix a LIPO issue.
>
> This patch addresses handling for static initializer data during
> static variable promotion in LIPO optimize phase. This is useful for
> those targets which access initializer data via TOC, such as powerpc.
>
> After static var promotion in two different modules, we have the
> following which leads to multiple definition of ._41" error during
> link time.
>
> Module 1                     Module 2
>      .hidden ._41.cmo.1           .hidden ._41.cmo.3
>      .globl ._41                  .globl ._41
> ._41:                        ._41:
>   ...                          ...
>
>
> Instead we should use the appropriate unique names for initializer
> data as in the following.
>
> Module 1                     Module 2
>      .hidden ._41.cmo.1           .hidden ._41.cmo.3
>      .globl ._41.cmo.1            .globl ._41.cmo.3
> ._41.cmo.1:                  ._41.cmo.3:
> ...                          ...
>
>
> Tested on powerpc as well as ran manual tests. Okay for google/4_9 branch?
>
> Thanks,
> Sharad



More information about the Gcc-patches mailing list