blob: 1a62d560b93a440fb52ed0c0ea8c0e4e018509a9 [file] [log] [blame]
Michael J. Spencerdfa18962012-02-28 00:40:37 +00001; How to make the shared objects from this file:
2;
David Meyer5c2b4ea2012-03-01 01:36:50 +00003; LDARGS="--unresolved-symbols=ignore-all -soname=libfoo.so --no-as-needed -lc -lm"
4;
Michael J. Spencerdfa18962012-02-28 00:40:37 +00005; X86-32 ELF:
6; llc -mtriple=i386-linux-gnu shared.ll -filetype=obj -o tmp32.o -relocation-model=pic
David Meyer5c2b4ea2012-03-01 01:36:50 +00007; ld -melf_i386 -shared tmp32.o -o shared-object-test.elf-i386 $LDARGS
Michael J. Spencerdfa18962012-02-28 00:40:37 +00008;
9; X86-64 ELF:
10; llc -mtriple=x86_64-linux-gnu shared.ll -filetype=obj -o tmp64.o -relocation-model=pic
David Meyer5c2b4ea2012-03-01 01:36:50 +000011; ld -melf_x86_64 -shared tmp64.o -o shared-object-test.elf-x86-64 $LDARGS
Michael J. Spencerdfa18962012-02-28 00:40:37 +000012
13@defined_sym = global i32 1, align 4
14
15@tls_sym = thread_local global i32 2, align 4
16
17@undef_sym = external global i32
18
19@undef_tls_sym = external thread_local global i32
20
21@common_sym = common global i32 0, align 4
22
23define i32 @global_func() nounwind uwtable {
24entry:
25 ret i32 0
26}
27
28declare i32 @undef_func(...)
29
30define internal i32 @local_func() nounwind uwtable {
31entry:
32 ret i32 0
33}