Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mips] Add SHF_MIPS_GPREL flag to the MIPS .sbss and .sdata sections
MIPS ABI states that .sbss and .sdata sections must have SHF_MIPS_GPREL flag. See Figure 4–7 on page 69 in the following document: ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf. Differential Revision: http://reviews.llvm.org/D15740 llvm-svn: 259641
- Loading branch information
Showing
2 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
; Check that .sdata section has SHF_MIPS_GPREL flag. | ||
|
||
; RUN: llc -mips-ssection-threshold=16 -mgpopt -mattr=noabicalls \ | ||
; RUN: -relocation-model=static -march=mips -o - %s -filetype=obj \ | ||
; RUN: | llvm-readobj -s | FileCheck %s | ||
|
||
@data1 = global [4 x i32] [i32 1, i32 2, i32 3, i32 4], align 4 | ||
@date2 = global [4 x i32] zeroinitializer, align 4 | ||
|
||
; CHECK: Name: .sdata | ||
; CHECK-NEXT: Type: SHT_PROGBITS | ||
; CHECK-NEXT: Flags [ (0x10000003) | ||
; CHECK-NEXT: SHF_ALLOC | ||
; CHECK-NEXT: SHF_MIPS_GPREL | ||
; CHECK-NEXT: SHF_WRITE | ||
; CHECK-NEXT: ] | ||
|
||
; CHECK: Name: .sbss | ||
; CHECK-NEXT: Type: SHT_NOBITS | ||
; CHECK-NEXT: Flags [ (0x10000003) | ||
; CHECK-NEXT: SHF_ALLOC | ||
; CHECK-NEXT: SHF_MIPS_GPREL | ||
; CHECK-NEXT: SHF_WRITE | ||
; CHECK-NEXT: ] |