Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark ELF sections whose name start with .note as note
Previously, such section would be marked as SHT_PROGBITS which makes it impossible to use an initialized C variable declaration to emit an (allocated) ELF note. The new behavior is also consistent with ELF assembly parser. Differential Revision: https://reviews.llvm.org/D24692 llvm-svn: 282010
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 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,19 @@ | ||
; RUN: llc -mtriple x86_64-pc-linux < %s | FileCheck %s | ||
|
||
%struct.note = type { %struct.Elf32_Nhdr, [7 x i8], %struct.payload } | ||
%struct.Elf32_Nhdr = type { i32, i32, i32 } | ||
%struct.payload = type { i16 } | ||
|
||
@foonote = internal constant %struct.note { %struct.Elf32_Nhdr { i32 7, i32 2, i32 17 }, [7 x i8] c"foobar\00", %struct.payload { i16 23 } }, section ".note.foo", align 4 | ||
|
||
; CHECK: .section .note.foo,"a",@note | ||
; CHECK-NEXT: .p2align 2 | ||
; CHECK-NEXT: foonote: | ||
; CHECK-NEXT: .long 7 | ||
; CHECK-NEXT: .long 2 | ||
; CHECK-NEXT: .long 17 | ||
; CHECK-NEXT: .asciz "foobar" | ||
; CHECK-NEXT: .zero 1 | ||
; CHECK-NEXT: .short 23 | ||
; CHECK-NEXT: .zero 2 | ||
; CHECK-NEXT: .size foonote, 24 |