And also set the SHF_X86_64_LARGE section flag. gcc only uses the "l" prefix and SHF_X86_64_LARGE in the medium code model for data larger than -mlarge-data-threshold. But it seems more consistent to use it in the large code model as well in case separate parts of the binary aren't compiled with the large code model and also have a .data/.bss/.rodata section. Reviewed By: MaskRay, tkoeppe Differential Revision: https://reviews.llvm.org/D148836
44 lines
1.9 KiB
LLVM
44 lines
1.9 KiB
LLVM
; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=small -o %t
|
|
; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL
|
|
; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=medium -o %t
|
|
; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=LARGE
|
|
; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=large -o %t
|
|
; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL
|
|
|
|
; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=small -data-sections -o %t
|
|
; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL-DS
|
|
; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=medium -data-sections -o %t
|
|
; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=LARGE-DS
|
|
; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=large -data-sections -o %t
|
|
; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL-DS
|
|
|
|
; SMALL: .data {{.*}} WA {{.*}}
|
|
; SMALL: .bss {{.*}} WA {{.*}}
|
|
; SMALL: .rodata {{.*}} A {{.*}}
|
|
; SMALL: .data.rel.ro {{.*}} WA {{.*}}
|
|
|
|
; SMALL-DS: .data.data {{.*}} WA {{.*}}
|
|
; SMALL-DS: .bss.bss {{.*}} WA {{.*}}
|
|
; SMALL-DS: .rodata.rodata {{.*}} A {{.*}}
|
|
; SMALL-DS: .data.rel.ro.relro {{.*}} WA {{.*}}
|
|
|
|
; LARGE: .ldata {{.*}} WAl {{.*}}
|
|
; LARGE: .lbss {{.*}} WAl {{.*}}
|
|
; LARGE: .lrodata {{.*}} Al {{.*}}
|
|
; LARGE: .ldata.rel.ro {{.*}} WAl {{.*}}
|
|
|
|
; LARGE-DS: .ldata.data {{.*}} WAl {{.*}}
|
|
; LARGE-DS: .lbss.bss {{.*}} WAl {{.*}}
|
|
; LARGE-DS: .lrodata.rodata {{.*}} Al {{.*}}
|
|
; LARGE-DS: .ldata.rel.ro.relro {{.*}} WAl {{.*}}
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
target triple = "x86_64--linux"
|
|
|
|
@data = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0]
|
|
@bss = internal global [10 x i64] zeroinitializer
|
|
@rodata = internal constant [10 x i64] zeroinitializer
|
|
@relro = internal constant [10 x ptr] [ptr @func, ptr @func, ptr @func, ptr @func, ptr @func, ptr @func, ptr @func, ptr @func, ptr @func, ptr @func]
|
|
|
|
declare void @func()
|