2019-05-01 13:27:20 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -S | FileCheck %s
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-apple-darwin14.0.0-elf %s -o - | llvm-readobj -S | FileCheck %s -check-prefix=DARWIN
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32-elf %s -o - | llvm-readobj -S | FileCheck %s -check-prefix=WINDOWS
|
2015-05-05 04:03:01 +08:00
|
|
|
|
|
|
|
// Check that we can create ELF files for darwin/windows, even though
|
|
|
|
// it is not the default file format.
|
|
|
|
|
|
|
|
// DARWIN: Format: ELF64-x86-64
|
|
|
|
// WINDOWS: Format: ELF64-x86-64
|
|
|
|
// DARWIN-NEXT: Arch: x86_64
|
|
|
|
// WINDOWS-NEXT: Arch: x86_64
|
2010-09-16 05:48:40 +08:00
|
|
|
|
2015-11-04 04:02:22 +08:00
|
|
|
// Test that we create text by default. Also test that symtab and strtab are
|
|
|
|
// listed.
|
2010-09-16 05:48:40 +08:00
|
|
|
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK: Section {
|
Produce a single string table in a ELF .o
Normally an ELF .o has two string tables, one for symbols, one for section
names.
With the scheme of naming sections like ".text.foo" where foo is a symbol,
there is a big potential saving in using a single one.
Building llvm+clang+lld with master and with this patch the results were:
master: 193,267,008 bytes
patch: 186,107,952 bytes
master non unique section names: 183,260,192 bytes
patch non unique section names: 183,118,632 bytes
So using non usique saves 10,006,816 bytes, and the patch saves 7,159,056 while
still using distinct names for the sections.
llvm-svn: 238073
2015-05-23 07:58:30 +08:00
|
|
|
// CHECK: Name: .strtab
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK-NEXT: Type: SHT_STRTAB
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
|
|
|
// CHECK-NEXT: Offset:
|
2015-11-04 04:02:22 +08:00
|
|
|
// CHECK-NEXT: Size: 23
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 1
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: }
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Section {
|
|
|
|
// CHECK: Name: .text
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
|
|
// CHECK-NEXT: SHF_EXECINSTR
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
|
|
|
// CHECK-NEXT: Offset: 0x40
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Link: 0
|
|
|
|
// CHECK-NEXT: Info: 0
|
|
|
|
// CHECK-NEXT: AddressAlignment: 4
|
|
|
|
// CHECK-NEXT: EntrySize: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK: Section {
|
|
|
|
// CHECK: Name: .symtab
|
|
|
|
// CHECK-NEXT: Type: SHT_SYMTAB
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
|
|
|
// CHECK-NEXT: Offset:
|
2015-06-04 23:33:30 +08:00
|
|
|
// CHECK-NEXT: Size: 24
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK-NEXT: Link:
|
2015-06-04 23:33:30 +08:00
|
|
|
// CHECK-NEXT: Info: 1
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: AddressAlignment: 8
|
|
|
|
// CHECK-NEXT: EntrySize: 24
|
|
|
|
// CHECK-NEXT: }
|