[PATCH] D43858: Do not create multiple NOTE segments.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 09:59:42 PST 2018


The sorting change seems like a good idea.

> +// RUN: echo "SECTIONS { .note : { *(.note.a) *(.note.b) } }" > %t.script
> +// RUN: ld.lld %t.o --script %t.script -o %t2
> +// RUN: llvm-readobj -program-headers %t2 | FileCheck -check-prefix=SCRIPT %s
> +
> +// SCRIPT:      Type: PT_NOTE
> +// SCRIPT-NEXT: Offset: 0x1008
> +// SCRIPT-NEXT: VirtualAddress: 0x8
> +// SCRIPT-NEXT: PhysicalAddress: 0x8
> +// SCRIPT-NEXT: FileSize: 16
> +// SCRIPT-NEXT: MemSize: 16
> +// SCRIPT-NEXT: Flags [
> +// SCRIPT-NEXT:   PF_R
> +// SCRIPT-NEXT: ]
> +// SCRIPT-NEXT: Alignment: 1
> +
>  .section .note.a, "a", @note
>  .quad 0
>  
> -.section .note.b, "a", @note
> +.section .foo, "a"

The test change is odd. You still have .note.b in the script but you
renamed this section.

Cheers,
Rafael


More information about the llvm-commits mailing list