mirror of
https://github.com/intel/llvm.git
synced 2026-02-03 02:26:27 +08:00
Don't lower the visibility because of shared symbols.
If a shared library has a protected symbol 'foo', that doesn't imply that the symbol 'foo' in the output should be protected or not. llvm-svn: 265794
This commit is contained in:
@@ -218,9 +218,11 @@ int SymbolBody::compare(SymbolBody *Other) {
|
||||
if (L > R)
|
||||
return -Other->compare(this);
|
||||
|
||||
uint8_t V = getMinVisibility(getVisibility(), Other->getVisibility());
|
||||
setVisibility(V);
|
||||
Other->setVisibility(V);
|
||||
if (!isShared() && !Other->isShared()) {
|
||||
uint8_t V = getMinVisibility(getVisibility(), Other->getVisibility());
|
||||
setVisibility(V);
|
||||
Other->setVisibility(V);
|
||||
}
|
||||
|
||||
if (IsUsedInRegularObj || Other->IsUsedInRegularObj)
|
||||
IsUsedInRegularObj = Other->IsUsedInRegularObj = true;
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
.global foo
|
||||
.protected foo
|
||||
foo:
|
||||
|
||||
.global bar
|
||||
.protected bar
|
||||
bar:
|
||||
|
||||
@@ -9,6 +9,17 @@
|
||||
_start:
|
||||
.quad foo
|
||||
|
||||
.global bar
|
||||
bar:
|
||||
|
||||
// CHECK: Name: bar
|
||||
// CHECK-NEXT: Value:
|
||||
// CHECK-NEXT: Size: 0
|
||||
// CHECK-NEXT: Binding: Global
|
||||
// CHECK-NEXT: Type: None
|
||||
// CHECK-NEXT: Other: 0
|
||||
// CHECK-NEXT: Section: .text
|
||||
|
||||
// CHECK: Name: foo
|
||||
// CHECK-NEXT: Value: 0x0
|
||||
// CHECK-NEXT: Size: 0
|
||||
|
||||
Reference in New Issue
Block a user