62 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3# RUN: ld.lld %t -o %tout4# RUN: llvm-readobj --sections %tout | FileCheck %s5 6# Check that sections are laid out in the correct order.7 8.global _start9.text10_start:11 12.section t,"x",@nobits13.section s,"x"14.section r,"w",@nobits15.section q,"w"16.section p,"wx",@nobits17.section o,"wx"18.section n,"",@nobits19.section m,""20 21.section l,"awx",@nobits22.section k,"awx"23.section j,"aw",@nobits24.section i,"aw"25.section g,"awT",@nobits26.section e,"awT"27.section d,"ax",@nobits28.section c,"ax"29.section a,"a",@nobits30.section b,"a"31 32// For non-executable and non-writable sections, PROGBITS appear after others.33// CHECK: Name: a34// CHECK: Name: b35 36// CHECK: Name: c37// CHECK: Name: d38 39// Sections that are both writable and executable appear before40// sections that are only writable.41// CHECK: Name: k42// CHECK: Name: l43 44// TLS sections are only sorted on NOBITS.45// CHECK: Name: e46// CHECK: Name: g47 48// Writable sections appear after TLS and other relro sections.49// CHECK: Name: i50 51// CHECK: Name: j52 53// Non allocated sections are in input order.54// CHECK: Name: t55// CHECK: Name: s56// CHECK: Name: r57// CHECK: Name: q58// CHECK: Name: p59// CHECK: Name: o60// CHECK: Name: n61// CHECK: Name: m62