| 1 |
## Ensure that the visibility of the start, end and size symbols created when |
| 2 |
## using binary input can be specified with the --new-symbol-visibility switch. |
| 3 |
|
| 4 |
# RUN: llvm-objcopy -I binary -O elf64-x86-64 %s %t.unspecified |
| 5 |
# RUN: llvm-readelf -s %t.unspecified | FileCheck %s --check-prefix=BINARY -DVISIBILITY=DEFAULT |
| 6 |
# RUN: llvm-objcopy --new-symbol-visibility default -I binary -O elf64-x86-64 %s %t.default |
| 7 |
# RUN: llvm-readelf -s %t.default | FileCheck %s --check-prefix=BINARY -DVISIBILITY=DEFAULT |
| 8 |
# RUN: llvm-objcopy --new-symbol-visibility hidden -I binary -O elf64-x86-64 %s %t.hidden |
| 9 |
# RUN: llvm-readelf -s %t.hidden | FileCheck %s --check-prefix=BINARY -DVISIBILITY=HIDDEN |
| 10 |
# RUN: llvm-objcopy --new-symbol-visibility protected -I binary -O elf64-x86-64 %s %t.protected |
| 11 |
# RUN: llvm-readelf -s %t.protected | FileCheck %s --check-prefix=BINARY -DVISIBILITY=PROTECTED |
| 12 |
# RUN: llvm-objcopy --new-symbol-visibility internal -I binary -O elf64-x86-64 %s %t.internal |
| 13 |
# RUN: llvm-readelf -s %t.internal | FileCheck %s --check-prefix=BINARY -DVISIBILITY=INTERNAL |
| 14 |
|
| 15 |
# BINARY: [[VISIBILITY]] {{.*}} _binary{{.*}}_start |
| 16 |
# BINARY-NEXT: [[VISIBILITY]] {{.*}} _binary{{.*}}_end |
| 17 |
# BINARY-NEXT: [[VISIBILITY]] {{.*}} _binary{{.*}}_size |
| 18 |
|
| 19 |
# RUN: not llvm-objcopy --new-symbol-visibility fluff -I binary -O elf64-x86-64 \ |
| 20 |
# RUN: %s %t.error 2>&1 | FileCheck %s --check-prefix=ERR |
| 21 |
|
| 22 |
# ERR: error: 'fluff' is not a valid symbol visibility |