dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0121-include-grub-elf.h-Update-ARM-definitions-based-on-b.patch

f96e0b
From 12afe18a58fd41bbf739b71c08409283dca2a8d8 Mon Sep 17 00:00:00 2001
f96e0b
From: Leif Lindholm <leif.lindholm@arm.com>
f96e0b
Date: Sun, 20 Jan 2013 23:01:47 +0100
f96e0b
Subject: [PATCH 121/482] 	* include/grub/elf.h: Update ARM definitions
f96e0b
 based on binutils.
f96e0b
f96e0b
---
f96e0b
 ChangeLog          |  4 ++++
f96e0b
 include/grub/elf.h | 65 +++++++++++++++++++++++++++++++++++++++++++++---------
f96e0b
 2 files changed, 58 insertions(+), 11 deletions(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index c8edf73..e82ee8d 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,3 +1,7 @@
f96e0b
+2013-01-20  Leif Lindholm  <leif.lindholm@arm.com>
f96e0b
+
f96e0b
+	* include/grub/elf.h: Update ARM definitions based on binutils.
f96e0b
+
f96e0b
 2013-01-20  Aleš Nesrsta  <starous@volny.cz>
f96e0b
 
f96e0b
 	Split long USB transfers into short ones.
f96e0b
diff --git a/include/grub/elf.h b/include/grub/elf.h
f96e0b
index 9a75b52..d4a2a5f 100644
f96e0b
--- a/include/grub/elf.h
f96e0b
+++ b/include/grub/elf.h
f96e0b
@@ -145,6 +145,7 @@ typedef struct
f96e0b
 #define ELFOSABI_TRU64		10	/* Compaq TRU64 UNIX.  */
f96e0b
 #define ELFOSABI_MODESTO	11	/* Novell Modesto.  */
f96e0b
 #define ELFOSABI_OPENBSD	12	/* OpenBSD.  */
f96e0b
+#define ELFOSABI_ARM_AEABI	64	/* ARM EABI */
f96e0b
 #define ELFOSABI_ARM		97	/* ARM */
f96e0b
 #define ELFOSABI_STANDALONE	255	/* Standalone (embedded) application */
f96e0b
 
f96e0b
@@ -2005,15 +2006,18 @@ typedef Elf32_Addr Elf32_Conflict;
f96e0b
 /* ARM specific declarations */
f96e0b
 
f96e0b
 /* Processor specific flags for the ELF header e_flags field.  */
f96e0b
-#define EF_ARM_RELEXEC     0x01
f96e0b
-#define EF_ARM_HASENTRY    0x02
f96e0b
-#define EF_ARM_INTERWORK   0x04
f96e0b
-#define EF_ARM_APCS_26     0x08
f96e0b
-#define EF_ARM_APCS_FLOAT  0x10
f96e0b
-#define EF_ARM_PIC         0x20
f96e0b
-#define EF_ARM_ALIGN8      0x40		/* 8-bit structure alignment is in use */
f96e0b
-#define EF_ARM_NEW_ABI     0x80
f96e0b
-#define EF_ARM_OLD_ABI     0x100
f96e0b
+#define EF_ARM_RELEXEC     	0x01
f96e0b
+#define EF_ARM_HASENTRY    	0x02
f96e0b
+#define EF_ARM_INTERWORK   	0x04
f96e0b
+#define EF_ARM_APCS_26     	0x08
f96e0b
+#define EF_ARM_APCS_FLOAT  	0x10
f96e0b
+#define EF_ARM_PIC         	0x20
f96e0b
+#define EF_ARM_ALIGN8      	0x40 /* 8-bit structure alignment is in use */
f96e0b
+#define EF_ARM_NEW_ABI     	0x80
f96e0b
+#define EF_ARM_OLD_ABI     	0x100
f96e0b
+#define EF_ARM_SOFT_FLOAT	0x200
f96e0b
+#define EF_ARM_VFP_FLOAT	0x400
f96e0b
+#define EF_ARM_MAVERICK_FLOAT	0x800
f96e0b
 
f96e0b
 /* Other constants defined in the ARM ELF spec. version B-01.  */
f96e0b
 /* NB. These conflict with values defined above.  */
f96e0b
@@ -2022,13 +2026,21 @@ typedef Elf32_Addr Elf32_Conflict;
f96e0b
 #define EF_ARM_MAPSYMSFIRST	0x10
f96e0b
 #define EF_ARM_EABIMASK		0XFF000000
f96e0b
 
f96e0b
+/* Constants defined in AAELF.  */
f96e0b
+#define EF_ARM_BE8	    0x00800000
f96e0b
+#define EF_ARM_LE8	    0x00400000
f96e0b
+
f96e0b
 #define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
f96e0b
 #define EF_ARM_EABI_UNKNOWN  0x00000000
f96e0b
 #define EF_ARM_EABI_VER1     0x01000000
f96e0b
 #define EF_ARM_EABI_VER2     0x02000000
f96e0b
+#define EF_ARM_EABI_VER3     0x03000000
f96e0b
+#define EF_ARM_EABI_VER4     0x04000000
f96e0b
+#define EF_ARM_EABI_VER5     0x05000000
f96e0b
 
f96e0b
 /* Additional symbol types for Thumb */
f96e0b
-#define STT_ARM_TFUNC      0xd
f96e0b
+#define STT_ARM_TFUNC	     STT_LOPROC /* A Thumb function.  */
f96e0b
+#define STT_ARM_16BIT	     STT_HIPROC /* A Thumb label.  */
f96e0b
 
f96e0b
 /* ARM-specific values for sh_flags */
f96e0b
 #define SHF_ARM_ENTRYSECT  0x10000000   /* Section contains an entry point */
f96e0b
@@ -2038,6 +2050,17 @@ typedef Elf32_Addr Elf32_Conflict;
f96e0b
 /* ARM-specific program header flags */
f96e0b
 #define PF_ARM_SB          0x10000000   /* Segment contains the location
f96e0b
 					   addressed by the static base */
f96e0b
+#define PF_ARM_PI	   0x20000000   /* Position-independent segment.  */
f96e0b
+#define PF_ARM_ABS	   0x40000000   /* Absolute segment.  */
f96e0b
+
f96e0b
+/* Processor specific values for the Phdr p_type field.  */
f96e0b
+#define PT_ARM_EXIDX		(PT_LOPROC + 1)	/* ARM unwind segment.  */
f96e0b
+
f96e0b
+/* Processor specific values for the Shdr sh_type field.  */
f96e0b
+#define SHT_ARM_EXIDX		(SHT_LOPROC + 1) /* ARM unwind section.  */
f96e0b
+#define SHT_ARM_PREEMPTMAP	(SHT_LOPROC + 2) /* Preemption details.  */
f96e0b
+#define SHT_ARM_ATTRIBUTES	(SHT_LOPROC + 3) /* ARM attributes section.  */
f96e0b
+
f96e0b
 
f96e0b
 /* ARM relocs.  */
f96e0b
 #define R_ARM_NONE		0	/* No reloc */
f96e0b
@@ -2050,7 +2073,7 @@ typedef Elf32_Addr Elf32_Conflict;
f96e0b
 #define R_ARM_THM_ABS5		7
f96e0b
 #define R_ARM_ABS8		8	/* Direct 8 bit */
f96e0b
 #define R_ARM_SBREL32		9
f96e0b
-#define R_ARM_THM_PC22		10
f96e0b
+#define R_ARM_THM_CALL		10
f96e0b
 #define R_ARM_THM_PC8		11
f96e0b
 #define R_ARM_AMP_VCALL9	12
f96e0b
 #define R_ARM_SWI24		13
f96e0b
@@ -2065,16 +2088,36 @@ typedef Elf32_Addr Elf32_Conflict;
f96e0b
 #define R_ARM_GOTPC		25	/* 32 bit PC relative offset to GOT */
f96e0b
 #define R_ARM_GOT32		26	/* 32 bit GOT entry */
f96e0b
 #define R_ARM_PLT32		27	/* 32 bit PLT address */
f96e0b
+#define R_ARM_CALL		28
f96e0b
+#define R_ARM_JUMP24		29
f96e0b
+#define R_ARM_THM_JUMP24	30
f96e0b
+#define R_ARM_BASE_ABS		31
f96e0b
 #define R_ARM_ALU_PCREL_7_0	32
f96e0b
 #define R_ARM_ALU_PCREL_15_8	33
f96e0b
 #define R_ARM_ALU_PCREL_23_15	34
f96e0b
 #define R_ARM_LDR_SBREL_11_0	35
f96e0b
 #define R_ARM_ALU_SBREL_19_12	36
f96e0b
 #define R_ARM_ALU_SBREL_27_20	37
f96e0b
+#define R_ARM_TLS_GOTDESC	90
f96e0b
+#define R_ARM_TLS_CALL		91
f96e0b
+#define R_ARM_TLS_DESCSEQ	92
f96e0b
+#define R_ARM_THM_TLS_CALL	93
f96e0b
 #define R_ARM_GNU_VTENTRY	100
f96e0b
 #define R_ARM_GNU_VTINHERIT	101
f96e0b
 #define R_ARM_THM_PC11		102	/* thumb unconditional branch */
f96e0b
 #define R_ARM_THM_PC9		103	/* thumb conditional branch */
f96e0b
+#define R_ARM_TLS_GD32		104	/* PC-rel 32 bit for global dynamic
f96e0b
+					   thread local data */
f96e0b
+#define R_ARM_TLS_LDM32		105	/* PC-rel 32 bit for local dynamic
f96e0b
+					   thread local data */
f96e0b
+#define R_ARM_TLS_LDO32		106	/* 32 bit offset relative to TLS
f96e0b
+					   block */
f96e0b
+#define R_ARM_TLS_IE32		107	/* PC-rel 32 bit for GOT entry of
f96e0b
+					   static TLS block offset */
f96e0b
+#define R_ARM_TLS_LE32		108	/* 32 bit offset relative to static
f96e0b
+					   TLS block */
f96e0b
+#define	R_ARM_THM_TLS_DESCSEQ	129
f96e0b
+#define R_ARM_IRELATIVE		160
f96e0b
 #define R_ARM_RXPC25		249
f96e0b
 #define R_ARM_RSBREL32		250
f96e0b
 #define R_ARM_THM_RPC22		251
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b