[WebAssembly] Define a custom segment type for function definitions.
authorDan Gohman <dan433584@gmail.com>
Tue, 12 Jan 2016 02:58:12 +0000 (02:58 +0000)
committerDan Gohman <dan433584@gmail.com>
Tue, 12 Jan 2016 02:58:12 +0000 (02:58 +0000)
Since function definitions are not loaded into the address space, PT_LOAD is
inappropriate. PT_WEBASSEMBLY_FUNCTIONS is used to identify where the function
definitions are so that they can be processed at program startup time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257436 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/ELF.h

index 33975688c2413422a439853876ff980be3ff70a4..9ff84bda5640a801a68c269442830f7f49a05cdd 100644 (file)
@@ -1029,7 +1029,10 @@ enum {
   PT_AMDGPU_HSA_LOAD_GLOBAL_PROGRAM = 0x60000000,
   PT_AMDGPU_HSA_LOAD_GLOBAL_AGENT   = 0x60000001,
   PT_AMDGPU_HSA_LOAD_READONLY_AGENT = 0x60000002,
   PT_AMDGPU_HSA_LOAD_GLOBAL_PROGRAM = 0x60000000,
   PT_AMDGPU_HSA_LOAD_GLOBAL_AGENT   = 0x60000001,
   PT_AMDGPU_HSA_LOAD_READONLY_AGENT = 0x60000002,
-  PT_AMDGPU_HSA_LOAD_CODE_AGENT     = 0x60000003
+  PT_AMDGPU_HSA_LOAD_CODE_AGENT     = 0x60000003,
+
+  // WebAssembly program header types.
+  PT_WEBASSEMBLY_FUNCTIONS = PT_LOPROC + 0, // Function definitions.
 };
 
 // Segment flag bits.
 };
 
 // Segment flag bits.