[PATCH] D23739: [LTO] Handles commons in monolithic LTO

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 13:13:07 PDT 2016


pcc added a comment.

This change doesn't look right to me.

  $ cat c1.c
  #include <stdio.h>
  
  short x;
  
  int main() {
    printf("%d\n", x);
  }
  $ cat c2.c
  int x = 42;
  $ src/llvm/ra/bin/clang -flto -fuse-ld=gold c1.c c2.c
  $ ./a.out 
  0

The previous implementation handled this correctly by tracking whether any common symbol prevailed.

As I mentioned before, these semantics are gold-specific, and I don't want any other linker to rely on them. If nothing else, can we put these semantics behind a flag?


Repository:
  rL LLVM

https://reviews.llvm.org/D23739





More information about the llvm-commits mailing list