2017-01-14 05:05:46 +08:00
|
|
|
// REQUIRES: x86
|
|
|
|
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/map-file2.s -o %t2.o
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/map-file3.s -o %t3.o
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/map-file4.s -o %t4.o
|
|
|
|
// RUN: rm -f %t4.a
|
|
|
|
// RUN: llvm-ar rc %t4.a %t4.o
|
2017-01-15 10:52:34 +08:00
|
|
|
// RUN: ld.lld %t1.o %t2.o %t3.o %t4.a -o %t -M | FileCheck %s
|
|
|
|
// RUN: ld.lld %t1.o %t2.o %t3.o %t4.a -o %t -print-map | FileCheck %s
|
|
|
|
// RUN: ld.lld %t1.o %t2.o %t3.o %t4.a -o %t -Map=%t.map
|
2017-01-14 05:05:46 +08:00
|
|
|
// RUN: FileCheck %s < %t.map
|
|
|
|
|
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
call baz
|
|
|
|
.global _Z1fi
|
|
|
|
_Z1fi:
|
|
|
|
.cfi_startproc
|
|
|
|
.cfi_endproc
|
|
|
|
nop
|
|
|
|
.weak bar
|
|
|
|
bar:
|
|
|
|
.long bar - .
|
|
|
|
.long zed - .
|
|
|
|
local:
|
2017-02-01 04:42:34 +08:00
|
|
|
.comm common,4,16
|
2017-01-14 05:05:46 +08:00
|
|
|
|
|
|
|
// CHECK: Address Size Align Out In File Symbol
|
2017-03-01 02:55:08 +08:00
|
|
|
// CHECK-NEXT: 0000000000200158 0000000000000030 8 .eh_frame
|
|
|
|
// CHECK-NEXT: 0000000000200158 0000000000000030 8 .eh_frame
|
2017-01-14 05:05:46 +08:00
|
|
|
// CHECK-NEXT: 0000000000201000 0000000000000015 4 .text
|
|
|
|
// CHECK-NEXT: 0000000000201000 000000000000000e 4 .text
|
2017-01-14 10:45:53 +08:00
|
|
|
// CHECK-NEXT: 0000000000201000 000000000000000e 4 {{.*}}{{/|\\}}map-file.s.tmp1.o
|
2017-01-14 05:05:46 +08:00
|
|
|
// CHECK-NEXT: 000000000020100e 0000000000000000 0 local
|
|
|
|
// CHECK-NEXT: 0000000000201005 0000000000000000 0 f(int)
|
|
|
|
// CHECK-NEXT: 0000000000201000 0000000000000000 0 _start
|
2017-01-14 10:45:53 +08:00
|
|
|
// CHECK-NEXT: 0000000000201010 0000000000000002 4 {{.*}}{{/|\\}}map-file.s.tmp2.o
|
2017-01-14 05:05:46 +08:00
|
|
|
// CHECK-NEXT: 0000000000201010 0000000000000000 0 foo
|
|
|
|
// CHECK-NEXT: 0000000000201011 0000000000000000 0 bar
|
|
|
|
// CHECK-NEXT: 0000000000201012 0000000000000000 1 .text.zed
|
2017-01-14 10:45:53 +08:00
|
|
|
// CHECK-NEXT: 0000000000201012 0000000000000000 1 {{.*}}{{/|\\}}map-file.s.tmp2.o
|
2017-01-14 05:05:46 +08:00
|
|
|
// CHECK-NEXT: 0000000000201012 0000000000000000 0 zed
|
|
|
|
// CHECK-NEXT: 0000000000201014 0000000000000000 4 .text
|
2017-01-14 10:45:53 +08:00
|
|
|
// CHECK-NEXT: 0000000000201014 0000000000000000 4 {{.*}}{{/|\\}}map-file.s.tmp3.o
|
2017-01-14 05:05:46 +08:00
|
|
|
// CHECK-NEXT: 0000000000201014 0000000000000000 0 bah
|
2017-01-14 10:45:53 +08:00
|
|
|
// CHECK-NEXT: 0000000000201014 0000000000000001 4 {{.*}}{{/|\\}}map-file.s.tmp4.a(map-file.s.tmp4.o)
|
2017-01-14 05:05:46 +08:00
|
|
|
// CHECK-NEXT: 0000000000201014 0000000000000000 0 baz
|
2017-02-01 04:42:34 +08:00
|
|
|
// CHECK-NEXT: 0000000000202000 0000000000000004 16 .bss
|
|
|
|
// CHECK-NEXT: 0000000000202000 0000000000000004 16 COMMON
|
2017-01-14 05:05:46 +08:00
|
|
|
// CHECK-NEXT: 0000000000000000 0000000000000008 1 .comment
|
2017-02-03 21:06:18 +08:00
|
|
|
// CHECK-NEXT: 0000000000000000 0000000000000008 1 .comment
|
2017-01-14 05:05:46 +08:00
|
|
|
// CHECK-NEXT: 0000000000000000 00000000000000f0 8 .symtab
|
|
|
|
// CHECK-NEXT: 0000000000000000 00000000000000f0 8 .symtab
|
|
|
|
// CHECK-NEXT: 0000000000000000 0000000000000039 1 .shstrtab
|
|
|
|
// CHECK-NEXT: 0000000000000000 0000000000000039 1 .shstrtab
|
|
|
|
// CHECK-NEXT: 0000000000000000 000000000000002f 1 .strtab
|
|
|
|
// CHECK-NEXT: 0000000000000000 000000000000002f 1 .strtab
|
2017-01-18 11:34:38 +08:00
|
|
|
|
|
|
|
// RUN: not ld.lld %t1.o %t2.o %t3.o %t4.a -o %t -Map=/ 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=FAIL %s
|
|
|
|
// FAIL: cannot open /
|