File: extend-pt-load2.test

package info (click to toggle)
llvm-toolchain-7 1%3A7.0.1-8
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 733,456 kB
  • sloc: cpp: 3,776,651; ansic: 633,271; asm: 350,301; python: 142,716; objc: 107,612; sh: 22,626; lisp: 11,056; perl: 7,999; pascal: 6,742; ml: 5,537; awk: 3,536; makefile: 2,557; cs: 2,027; xml: 841; ruby: 156
file content (24 lines) | stat: -rw-r--r-- 943 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/extend-pt-load.s -o %t.o
# RUN: ld.lld --hash-style=sysv -o %t2 --script %s %t.o -shared
# RUN: llvm-readobj --elf-output-style=GNU -l -s %t2 | FileCheck %s

# Then add the section bar. Note how bar is given AX flags, which causes the PT_LOAD to now
# cover the padding bits created by ALIGN.

SECTIONS {
  . = SIZEOF_HEADERS;
  .dynsym : {}
  .hash : {}
  .dynstr : {}
  .text : { *(.text) }
  bar : { . = ALIGN(0x1000); }
  .data.rel.ro : { *(.data.rel.ro) }
}

# CHECK:      .text        PROGBITS 00000000000001bc 0001bc 000001 00 AX
# CHECK-NEXT: bar          NOBITS   00000000000001bd 0001bd 000e43 00 AX
# CHECK-NEXT: .data.rel.ro PROGBITS 0000000000001000 001000 000001 00 WA

# CHECK:      LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x0001bd 0x001000 R E
# CHECK-NEXT: LOAD 0x001000 0x0000000000001000 0x0000000000001000 0x000068 0x000068 RW