AMDGPU: Emit runtime metadata as a note element in .note section

Currently runtime metadata is emitted as an ELF section with name .AMDGPU.runtime_metadata.

However there is a standard way to convey vendor specific information about how to run an ELF binary, which is called vendor-specific note element (http://www.netbsd.org/docs/kernel/elf-notes.html).

This patch lets AMDGPU backend emits runtime metadata as a note element in .note section.

Differential Revision: https://reviews.llvm.org/D25781

llvm-svn: 286502
diff --git a/llvm/test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll b/llvm/test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll
index e169355..fb55337 100644
--- a/llvm/test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll
+++ b/llvm/test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll
@@ -1,9 +1,11 @@
 ; RUN: llc -mtriple=amdgcn--amdhsa < %s | FileCheck %s
 ; check llc does not crash for invalid opencl version metadata
 
-; CHECK: .section        .AMDGPU.runtime_metadata
-; CHECK-NEXT: .byte	1
-; CHECK-NEXT: .short	256
+; CHECK: .section        .note,#alloc
+; CHECK-NEXT: .long   4
+; CHECK-NEXT: .long   {{.+}}
+; CHECK-NEXT: .long   7
+; CHECK-NEXT: .asciz  "AMD"
 
 !opencl.ocl.version = !{!0}
 !0 = !{i32 1}