1 /* 2 * Copyright (c) 2024-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 package com.ohos.hapsigntool.codesigning.elf; 17 18 /** 19 * ELF struct define 20 * 21 * @since 2024/07/01 22 */ 23 public interface ElfDefine { 24 /** 25 * 32-bit elf file 26 */ 27 byte ELF_32_CLASS = 1; 28 29 /** 30 * 64-bit elf file 31 */ 32 byte ELF_64_CLASS = 2; 33 34 /** 35 * little endian 36 */ 37 byte ELF_DATA_2_LSB = 1; 38 39 /** 40 * big endian 41 */ 42 byte ELF_DATA_2_MSB = 2; 43 44 /** 45 * 32-bit elf file's program header length 46 */ 47 int ELF_PHEADER_32_LEN = 32; 48 49 /** 50 * 64-bit elf file's program header length 51 */ 52 int ELF_PHEADER_64_LEN = 56; 53 54 /** 55 * elf header e_ident length 56 */ 57 int EI_NIDENT_LEN = 16; 58 59 /** 60 * 32-bit elf header length 61 */ 62 int ELF_HEADER_32_LEN = EI_NIDENT_LEN + 36; 63 64 /** 65 * 64-bit elf header length 66 */ 67 int ELF_HEADER_64_LEN = EI_NIDENT_LEN + 48; 68 } 69