mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 11:46:07 +00:00

The difference from the previous try is that we no longer directly access function declarations from position independent executables. It should work, but currently doesn't with some linkers. It now includes a fix to not mark available_externally definitions as dso_local. Original message: Start setting dso_local in clang. This starts adding dso_local to clang. The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go away. My objective for now is to move enough of it to clang to remove the need for the TargetMachine one to handle PIE copy relocations and -fno-plt. With that it should then be easy to implement a -fno-copy-reloc in clang. This patch just adds the cases where we assume a symbol to be local based on the file being compiled for an executable or a shared library. llvm-svn: 324535
14 lines
346 B
C
14 lines
346 B
C
// REQUIRES: x86-registered-target
|
|
// RUN: %clang -target i386-unknown-unknown -emit-ast -o %t.ast %s
|
|
// RUN: %clang -target i386-unknown-unknown -emit-llvm -S -o - %t.ast | FileCheck %s
|
|
|
|
// CHECK: module asm "foo"
|
|
__asm__("foo");
|
|
|
|
// CHECK: @g0 = common dso_local global i32 0, align 4
|
|
int g0;
|
|
|
|
// CHECK: define dso_local i32 @f0()
|
|
int f0() {
|
|
}
|