From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UHKHz-000603-Kx for mharc-grub-devel@gnu.org; Sun, 17 Mar 2013 16:34:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHKHu-0005y7-Pn for grub-devel@gnu.org; Sun, 17 Mar 2013 16:34:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHKHr-0001jv-LC for grub-devel@gnu.org; Sun, 17 Mar 2013 16:34:38 -0400 Received: from mail-bk0-x22a.google.com ([2a00:1450:4008:c01::22a]:51608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHKHr-0001jb-Bl for grub-devel@gnu.org; Sun, 17 Mar 2013 16:34:35 -0400 Received: by mail-bk0-f42.google.com with SMTP id jk7so2212525bkc.15 for ; Sun, 17 Mar 2013 13:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=FtG/nlvPRwWU1BwY8ki3m9etZDBxyJOhXY6Fglx/DSQ=; b=fOgY/cgPsCE1cTwLpMOjBvkoKrwyR4aS97imeYRaJ2roiYnP35dD8We/QCP8yZMTw7 rAuGe8LceqAdHznZcaZ3qIRhfkoO8hAUriCwZGrA0je2VzqepQVDJ1dOU11tzrHc0hZ1 xuF7AUA+HQPSPKYbWb5KX/eaMtfuDAva8sNju3YnU6Is3f2+2dSQjmCaVEAzyFOn97Qe UfJkxXlKft3w9zDniXLX28DKTJQfBxzrOU+gL8c8/RAisfFhG6FHwLM90cQq9apo0F88 Tj9+WNFdMEuxkp5T3K5t9qlwESvJm82MSOsMeSHLA4IX60KZjmgHMKKIChicmkiID92j prEA== X-Received: by 10.205.13.193 with SMTP id pn1mr5784162bkb.114.1363552473960; Sun, 17 Mar 2013 13:34:33 -0700 (PDT) Received: from [192.168.56.2] ([81.81.104.214]) by mx.google.com with ESMTPS id k15sm4160484bku.0.2013.03.17.13.34.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 17 Mar 2013 13:34:33 -0700 (PDT) Message-ID: <51462936.1020106@gmail.com> Date: Sun, 17 Mar 2013 21:36:06 +0100 From: Francesco Lavra User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: The development of GNU GRUB Subject: [PATCH] Add missing ARM relocation codes and fix existing ones Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4008:c01::22a X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Mar 2013 20:34:42 -0000 I'm working on the GRUB port to ARM using the EFI platform. When generating a relocatable ARM image, some relocation entries use a relocation code (0x33) which is not defined in include/grub/elf.h. So I went through the latest edition of the ELF specification for the ARM architecture (ARM IHI 0044E) and added the missing definitions to the header file. I also noticed some differences between the existing definitions and the spec: some relocation names are different from the spec, some definitions aren't in the spec at all, and one (R_ARM_IRELATIVE) has a different value than that from the spec. So while at it I fixed those differences as well. Hence this patch. 2013-03-17 Francesco Lavra * include/grub/elf.h: Add missing ARM relocation codes and fix existing ones. === modified file 'include/grub/elf.h' --- include/grub/elf.h 2013-01-20 22:01:47 +0000 +++ include/grub/elf.h 2013-03-17 20:34:40 +0000 @@ -2067,7 +2067,7 @@ #define R_ARM_PC24 1 /* PC relative 26 bit branch */ #define R_ARM_ABS32 2 /* Direct 32 bit */ #define R_ARM_REL32 3 /* PC relative 32 bit */ -#define R_ARM_PC13 4 +#define R_ARM_LDR_PC_G0 4 #define R_ARM_ABS16 5 /* Direct 16 bit */ #define R_ARM_ABS12 6 /* Direct 12 bit */ #define R_ARM_THM_ABS5 7 @@ -2075,18 +2075,21 @@ #define R_ARM_SBREL32 9 #define R_ARM_THM_CALL 10 #define R_ARM_THM_PC8 11 -#define R_ARM_AMP_VCALL9 12 -#define R_ARM_SWI24 13 +#define R_ARM_BREL_ADJ 12 +#define R_ARM_TLS_DESC 13 #define R_ARM_THM_SWI8 14 #define R_ARM_XPC25 15 #define R_ARM_THM_XPC22 16 +#define R_ARM_TLS_DTPMOD32 17 +#define R_ARM_TLS_DTPOFF32 18 +#define R_ARM_TLS_TPOFF32 19 #define R_ARM_COPY 20 /* Copy symbol at runtime */ #define R_ARM_GLOB_DAT 21 /* Create GOT entry */ #define R_ARM_JUMP_SLOT 22 /* Create PLT entry */ #define R_ARM_RELATIVE 23 /* Adjust by program base */ -#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */ -#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */ -#define R_ARM_GOT32 26 /* 32 bit GOT entry */ +#define R_ARM_GOTOFF32 24 /* 32 bit offset to GOT */ +#define R_ARM_BASE_PREL 25 /* 32 bit PC relative offset to GOT */ +#define R_ARM_GOT_BREL 26 /* 32 bit GOT entry */ #define R_ARM_PLT32 27 /* 32 bit PLT address */ #define R_ARM_CALL 28 #define R_ARM_JUMP24 29 @@ -2098,14 +2101,72 @@ #define R_ARM_LDR_SBREL_11_0 35 #define R_ARM_ALU_SBREL_19_12 36 #define R_ARM_ALU_SBREL_27_20 37 +#define R_ARM_TARGET1 38 +#define R_ARM_SBREL31 39 +#define R_ARM_V4BX 40 +#define R_ARM_TARGET2 41 +#define R_ARM_PREL31 42 +#define R_ARM_MOVW_ABS_NC 43 +#define R_ARM_MOVT_ABS 44 +#define R_ARM_MOVW_PREL_NC 45 +#define R_ARM_MOVT_PREL 46 +#define R_ARM_THM_MOVW_ABS_NC 47 +#define R_ARM_THM_MOVT_ABS 48 +#define R_ARM_THM_MOVW_PREL_NC 49 +#define R_ARM_THM_MOVT_PREL 50 +#define R_ARM_THM_JUMP19 51 +#define R_ARM_THM_JUMP6 52 +#define R_ARM_THM_ALU_PREL_11_0 53 +#define R_ARM_THM_PC12 54 +#define R_ARM_ABS32_NOI 55 +#define R_ARM_REL32_NOI 56 +#define R_ARM_ALU_PC_G0_NC 57 +#define R_ARM_ALU_PC_G0 58 +#define R_ARM_ALU_PC_G1_NC 59 +#define R_ARM_ALU_PC_G1 60 +#define R_ARM_ALU_PC_G2 61 +#define R_ARM_LDR_PC_G1 62 +#define R_ARM_LDR_PC_G2 63 +#define R_ARM_LDRS_PC_G0 64 +#define R_ARM_LDRS_PC_G1 65 +#define R_ARM_LDRS_PC_G2 66 +#define R_ARM_LDC_PC_G0 67 +#define R_ARM_LDC_PC_G1 68 +#define R_ARM_LDC_PC_G2 69 +#define R_ARM_ALU_SB_G0_NC 70 +#define R_ARM_ALU_SB_G0 71 +#define R_ARM_ALU_SB_G1_NC 72 +#define R_ARM_ALU_SB_G1 73 +#define R_ARM_ALU_SB_G2 74 +#define R_ARM_LDR_SB_G0 75 +#define R_ARM_LDR_SB_G1 76 +#define R_ARM_LDR_SB_G2 77 +#define R_ARM_LDRS_SB_G0 78 +#define R_ARM_LDRS_SB_G1 79 +#define R_ARM_LDRS_SB_G2 80 +#define R_ARM_LDC_SB_G0 81 +#define R_ARM_LDC_SB_G1 82 +#define R_ARM_LDC_SB_G2 83 +#define R_ARM_MOVW_BREL_NC 84 +#define R_ARM_MOVT_BREL 85 +#define R_ARM_MOVW_BREL 86 +#define R_ARM_THM_MOVW_BREL_NC 87 +#define R_ARM_THM_MOVT_BREL 88 +#define R_ARM_THM_MOVW_BREL 89 #define R_ARM_TLS_GOTDESC 90 #define R_ARM_TLS_CALL 91 #define R_ARM_TLS_DESCSEQ 92 #define R_ARM_THM_TLS_CALL 93 +#define R_ARM_PLT32_ABS 94 +#define R_ARM_GOT_ABS 95 +#define R_ARM_GOT_PREL 96 +#define R_ARM_GOT_BREL12 97 +#define R_ARM_GOTOFF12 98 +#define R_ARM_GOTRELAX 99 #define R_ARM_GNU_VTENTRY 100 #define R_ARM_GNU_VTINHERIT 101 -#define R_ARM_THM_PC11 102 /* thumb unconditional branch */ -#define R_ARM_THM_PC9 103 /* thumb conditional branch */ +#define R_ARM_THM_JUMP11 102 /* thumb unconditional branch */ +#define R_ARM_THM_JUMP8 103 /* thumb conditional branch */ #define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic thread local data */ #define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic @@ -2116,15 +2177,30 @@ static TLS block offset */ #define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static TLS block */ -#define R_ARM_THM_TLS_DESCSEQ 129 -#define R_ARM_IRELATIVE 160 -#define R_ARM_RXPC25 249 -#define R_ARM_RSBREL32 250 -#define R_ARM_THM_RPC22 251 -#define R_ARM_RREL32 252 -#define R_ARM_RABS22 253 -#define R_ARM_RPC24 254 -#define R_ARM_RBASE 255 +#define R_ARM_TLS_LDO12 109 +#define R_ARM_TLS_LE12 110 +#define R_ARM_IE12GP 111 +#define R_ARM_PRIVATE_0 112 +#define R_ARM_PRIVATE_1 113 +#define R_ARM_PRIVATE_2 114 +#define R_ARM_PRIVATE_3 115 +#define R_ARM_PRIVATE_4 116 +#define R_ARM_PRIVATE_5 117 +#define R_ARM_PRIVATE_6 118 +#define R_ARM_PRIVATE_7 119 +#define R_ARM_PRIVATE_8 120 +#define R_ARM_PRIVATE_9 121 +#define R_ARM_PRIVATE_10 122 +#define R_ARM_PRIVATE_11 123 +#define R_ARM_PRIVATE_12 124 +#define R_ARM_PRIVATE_13 125 +#define R_ARM_PRIVATE_14 126 +#define R_ARM_PRIVATE_15 127 +#define R_ARM_ME_TOO 128 +#define R_ARM_THM_TLS_DESCSEQ16 129 +#define R_ARM_THM_TLS_DESCSEQ32 130 +#define R_ARM_THM_GOT_BREL12 131 +#define R_ARM_IRELATIVE 140 /* Keep this the last entry. */ #define R_ARM_NUM 256 -- Regards, Francesco