257 lines · plain
1# REQUIRES: x86,ppc2 3# RUN: echo ".globl foo; .data; .dc.a foo" > %te.s4# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %te.s -o %te-i386.o5# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %s -o %t-i386.o6# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t-x86_64.o7# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t-ppc64le.o8# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t-ppc64.o9 10# RUN: echo ".global zed; zed:" > %t2.s11# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %t2.s -o %t2-i386.o12# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t2.s -o %t2-x86_64.o13# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %t2.s -o %t2-ppc64le.o14# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %t2.s -o %t2-ppc64.o15 16# RUN: rm -f %t2-i386.a %t2-x86_64.a %t2-ppc64.a %t2-ppc64le.a17# RUN: llvm-ar rc %t2-i386.a %t2-i386.o18# RUN: llvm-ar rc %t2-x86_64.a %t2-x86_64.o19# RUN: llvm-ar rc %t2-ppc64le.a %t2-ppc64le.o20# RUN: llvm-ar rc %t2-ppc64.a %t2-ppc64.o21 22# RUN: echo ".global xyz; xyz:" > %t3.s23# RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %t3.s -o %t3-i386.o24# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t3.s -o %t3-x86_64.o25# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %t3.s -o %t3-ppc64le.o26# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %t3.s -o %t3-ppc64.o27 28# RUN: ld.lld -shared %t3-i386.o -o %t3-i386.so29# RUN: ld.lld -shared %t3-x86_64.o -o %t3-x86_64.so30# RUN: ld.lld -shared %t3-ppc64le.o -o %t3-ppc64le.so31# RUN: ld.lld -shared %t3-ppc64.o -o %t3-ppc64.so32 33# RUN: ld.lld -shared --hash-style=gnu -o %te-i386.so %te-i386.o34# RUN: ld.lld -shared -hash-style=gnu -o %t-i386.so %t-i386.o %t2-i386.a %t3-i386.so35# RUN: ld.lld -shared -hash-style=gnu -o %t-x86_64.so %t-x86_64.o %t2-x86_64.a %t3-x86_64.so36# RUN: ld.lld -shared --hash-style both -o %t-ppc64le.so %t-ppc64le.o %t2-ppc64le.a %t3-ppc64le.so37# RUN: ld.lld -shared --hash-style both -o %t-ppc64.so %t-ppc64.o %t2-ppc64.a %t3-ppc64.so38 39# RUN: llvm-readobj --dyn-syms --gnu-hash-table %te-i386.so \40# RUN: | FileCheck %s -check-prefix=EMPTY41# RUN: llvm-readobj --sections --dyn-syms --gnu-hash-table %t-i386.so \42# RUN: | FileCheck %s -check-prefix=I38643# RUN: llvm-readobj --sections --dyn-syms --gnu-hash-table %t-x86_64.so \44# RUN: | FileCheck %s -check-prefix=X86_6445# RUN: llvm-readobj --sections --dyn-syms --gnu-hash-table %t-ppc64le.so \46# RUN: | FileCheck %s -check-prefix=PPC6447# RUN: llvm-readobj --sections --dyn-syms --gnu-hash-table %t-ppc64.so \48# RUN: | FileCheck %s -check-prefix=PPC6449 50# EMPTY: DynamicSymbols [51# EMPTY: Symbol {52# EMPTY: Name: foo53# EMPTY-NEXT: Value: 0x054# EMPTY-NEXT: Size: 055# EMPTY-NEXT: Binding: Global56# EMPTY-NEXT: Type: None57# EMPTY-NEXT: Other: 058# EMPTY-NEXT: Section: Undefined59# EMPTY-NEXT: }60# EMPTY-NEXT: ]61# EMPTY: GnuHashTable {62# EMPTY-NEXT: Num Buckets: 163# EMPTY-NEXT: First Hashed Symbol Index: 264# EMPTY-NEXT: Num Mask Words: 165# EMPTY-NEXT: Shift Count: 2666# EMPTY-NEXT: Bloom Filter: [0x0]67# EMPTY-NEXT: Buckets: [0]68# EMPTY-NEXT: Values: []69# EMPTY-NEXT: }70 71# I386: Format: elf32-i38672# I386: Arch: i38673# I386: AddressSize: 32bit74# I386: Sections [75# I386: Name: .gnu.hash76# I386-NEXT: Type: SHT_GNU_HASH77# I386-NEXT: Flags [78# I386-NEXT: SHF_ALLOC79# I386-NEXT: ]80# I386-NEXT: Address:81# I386-NEXT: Offset:82# I386-NEXT: Size: 3283# I386-NEXT: Link:84# I386-NEXT: Info: 085# I386-NEXT: AddressAlignment: 486# I386-NEXT: EntrySize: 087# I386: ]88# I386: DynamicSymbols [89# I386: Symbol {90# I386: Name:91# I386: Binding: Local92# I386: Section: Undefined93# I386: }94# I386: Symbol {95# I386: Name: baz96# I386: Binding: Global97# I386: Section: Undefined98# I386: }99# I386: Symbol {100# I386: Name: xyz101# I386: Binding: Global102# I386: Section: Undefined103# I386: }104# I386: Symbol {105# I386: Name: zed106# I386: Binding: Weak107# I386: Section: Undefined108# I386: }109# I386: Symbol {110# I386: Name: bar111# I386: Binding: Global112# I386: Section: .text113# I386: }114# I386: Symbol {115# I386: Name: foo116# I386: Binding: Global117# I386: Section: .text118# I386: }119# I386: ]120# I386: GnuHashTable {121# I386-NEXT: Num Buckets: 1122# I386-NEXT: First Hashed Symbol Index: 4123# I386-NEXT: Num Mask Words: 1124# I386-NEXT: Shift Count: 26125# I386-NEXT: Bloom Filter: [0x4000204]126# I386-NEXT: Buckets: [4]127# I386-NEXT: Values: [0xB8860BA, 0xB887389]128# I386-NEXT: }129 130# X86_64: Format: elf64-x86-64131# X86_64: Arch: x86_64132# X86_64: AddressSize: 64bit133# X86_64: Sections [134# X86_64: Name: .gnu.hash135# X86_64-NEXT: Type: SHT_GNU_HASH136# X86_64-NEXT: Flags [137# X86_64-NEXT: SHF_ALLOC138# X86_64-NEXT: ]139# X86_64-NEXT: Address:140# X86_64-NEXT: Offset:141# X86_64-NEXT: Size: 36142# X86_64-NEXT: Link:143# X86_64-NEXT: Info: 0144# X86_64-NEXT: AddressAlignment: 8145# X86_64-NEXT: EntrySize: 0146# X86_64-NEXT: }147# X86_64: ]148# X86_64: DynamicSymbols [149# X86_64: Symbol {150# X86_64: Name:151# X86_64: Binding: Local152# X86_64: Section: Undefined153# X86_64: }154# X86_64: Symbol {155# X86_64: Name: baz156# X86_64: Binding: Global157# X86_64: Section: Undefined158# X86_64: }159# X86_64: Symbol {160# X86_64: Name: xyz161# X86_64: Binding: Global162# X86_64: Section: Undefined163# X86_64: }164# X86_64: Symbol {165# X86_64: Name: zed166# X86_64: Binding: Weak167# X86_64: Section: Undefined168# X86_64: }169# X86_64: Symbol {170# X86_64: Name: bar171# X86_64: Binding: Global172# X86_64: Section: .text173# X86_64: }174# X86_64: Symbol {175# X86_64: Name: foo176# X86_64: Binding: Global177# X86_64: Section: .text178# X86_64: }179# X86_64: ]180# X86_64: GnuHashTable {181# X86_64-NEXT: Num Buckets: 1182# X86_64-NEXT: First Hashed Symbol Index: 4183# X86_64-NEXT: Num Mask Words: 1184# X86_64-NEXT: Shift Count: 26185# X86_64-NEXT: Bloom Filter: [0x400000000000204]186# X86_64-NEXT: Buckets: [4]187# X86_64-NEXT: Values: [0xB8860BA, 0xB887389]188# X86_64-NEXT: }189 190# PPC64: Format: elf64-powerpc191# PPC64: Arch: powerpc64192# PPC64: AddressSize: 64bit193# PPC64: Sections [194# PPC64: Name: .gnu.hash195# PPC64-NEXT: Type: SHT_GNU_HASH196# PPC64-NEXT: Flags [197# PPC64-NEXT: SHF_ALLOC198# PPC64-NEXT: ]199# PPC64-NEXT: Address:200# PPC64-NEXT: Offset:201# PPC64-NEXT: Size: 36202# PPC64-NEXT: Link:203# PPC64-NEXT: Info: 0204# PPC64-NEXT: AddressAlignment: 8205# PPC64-NEXT: EntrySize: 0206# PPC64-NEXT: }207# PPC64: ]208# PPC64: DynamicSymbols [209# PPC64: Symbol {210# PPC64: Name:211# PPC64: Binding: Local212# PPC64: Section: Undefined213# PPC64: }214# PPC64: Symbol {215# PPC64: Name: baz216# PPC64: Binding: Global217# PPC64: Section: Undefined218# PPC64: }219# PPC64: Symbol {220# PPC64: Name: xyz221# PPC64: Binding: Global222# PPC64: Section: Undefined223# PPC64: }224# PPC64: Symbol {225# PPC64: Name: zed226# PPC64: Binding: Weak227# PPC64: Section: Undefined228# PPC64: }229# PPC64: Symbol {230# PPC64: Name: bar231# PPC64: Binding: Global232# PPC64: Section: .text233# PPC64: }234# PPC64: Symbol {235# PPC64: Name: foo236# PPC64: Binding: Global237# PPC64: Section: .text238# PPC64: }239# PPC64: ]240# PPC64: GnuHashTable {241# PPC64-NEXT: Num Buckets: 1242# PPC64-NEXT: First Hashed Symbol Index: 4243# PPC64-NEXT: Num Mask Words: 1244# PPC64-NEXT: Shift Count: 26245# PPC64-NEXT: Bloom Filter: [0x400000000000204]246# PPC64-NEXT: Buckets: [4]247# PPC64-NEXT: Values: [0xB8860BA, 0xB887389]248# PPC64-NEXT: }249 250.globl bar,baz,foo251foo:252bar:253.global xyz254.weak zed255.data256 .dc.a baz257