[PATCH] D36351: [lld][ELF] Add profile guided section layout

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 16:25:02 PST 2018


Testing the patch I have hit a case where the sorted program crashes.

I have uploaded the test to

 https://s3-us-west-2.amazonaws.com/linker-tests/t2.tar.xz


Michael Spencer via Phabricator <reviews at reviews.llvm.org> writes:


> Index: test/ELF/cgprofile-txt.s
> ===================================================================
> --- /dev/null
> +++ test/ELF/cgprofile-txt.s
> @@ -0,0 +1,69 @@
> +# REQUIRES: x86
> +
> +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
> +# RUN: ld.lld -e A %t -o %t2
> +# RUN: llvm-readobj -symbols %t2 | FileCheck %s --check-prefix=NOSORT
> +
> +# RUN: echo "A B 100" > %t.call_graph
> +# RUN: echo "A C 40" >> %t.call_graph
> +# RUN: echo "B C 30" >> %t.call_graph
> +# RUN: echo "C D 90" >> %t.call_graph
> +# RUN: echo "PP TS 100" >> %t.call_graph
> +# RUN: ld.lld -e A %t --call-graph-ordering-file %t.call_graph -o %t2
> +# RUN: llvm-readobj -symbols %t2 | FileCheck %s
> +
> +    .section    .text.D,"ax", at progbits
> +D:
> +    retq
> +
> +    .section    .text.C,"ax", at progbits
> +    .globl  C
> +C:
> +    retq
> +
> +    .section    .text.B,"ax", at progbits
> +    .globl  B
> +B:
> +    retq
> +
> +    .section    .text.A,"ax", at progbits
> +    .globl  A
> +A:
> +    retq
> +    
trailing white space.

> +    .section    .ponies,"ax", at progbits,unique,1
> +    .globl TS
> +TS:
> +    retq
> +    

trailing white space.

Cheers,
Rafael


More information about the llvm-commits mailing list