Page MenuHomeFreeBSD

D2611.id5576.diff
No OneTemporary

D2611.id5576.diff

Index: head/sys/arm/include/elf.h
===================================================================
--- head/sys/arm/include/elf.h
+++ head/sys/arm/include/elf.h
@@ -63,21 +63,21 @@
*/
/* Values for a_type. */
-#define AT_NULL 0 /* Terminates the vector. */
-#define AT_IGNORE 1 /* Ignored entry. */
-#define AT_EXECFD 2 /* File descriptor of program to load. */
-#define AT_PHDR 3 /* Program header of program already loaded. */
-#define AT_PHENT 4 /* Size of each program header entry. */
-#define AT_PHNUM 5 /* Number of program header entries. */
-#define AT_PAGESZ 6 /* Page size in bytes. */
-#define AT_BASE 7 /* Interpreter's base address. */
-#define AT_FLAGS 8 /* Flags (unused). */
-#define AT_ENTRY 9 /* Where interpreter should transfer control. */
-#define AT_NOTELF 10 /* Program is not ELF ?? */
-#define AT_UID 11 /* Real uid. */
-#define AT_EUID 12 /* Effective uid. */
-#define AT_GID 13 /* Real gid. */
-#define AT_EGID 14 /* Effective gid. */
+#define AT_NULL 0 /* Terminates the vector. */
+#define AT_IGNORE 1 /* Ignored entry. */
+#define AT_EXECFD 2 /* File descriptor of program to load. */
+#define AT_PHDR 3 /* Program header of program already loaded. */
+#define AT_PHENT 4 /* Size of each program header entry. */
+#define AT_PHNUM 5 /* Number of program header entries. */
+#define AT_PAGESZ 6 /* Page size in bytes. */
+#define AT_BASE 7 /* Interpreter's base address. */
+#define AT_FLAGS 8 /* Flags (unused). */
+#define AT_ENTRY 9 /* Where interpreter should transfer control. */
+#define AT_NOTELF 10 /* Program is not ELF ?? */
+#define AT_UID 11 /* Real uid. */
+#define AT_EUID 12 /* Effective uid. */
+#define AT_GID 13 /* Real gid. */
+#define AT_EGID 14 /* Effective gid. */
#define AT_EXECPATH 15 /* Path to the executable. */
#define AT_CANARY 16 /* Canary for SSP */
#define AT_CANARYLEN 17 /* Length of the canary. */
@@ -87,10 +87,11 @@
#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */
#define AT_TIMEKEEP 22 /* Pointer to timehands. */
#define AT_STACKPROT 23 /* Initial stack protection. */
+#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
-#define AT_COUNT 24 /* Count of defined aux entry types. */
+#define AT_COUNT 25 /* Count of defined aux entry types. */
-#define R_ARM_COUNT 33 /* Count of defined relocation types. */
+#define R_ARM_COUNT 33 /* Count of defined relocation types. */
/* Define "machine" characteristics */
@@ -104,16 +105,16 @@
#define ELF_TARG_VER 1
/* Defines specific for arm headers */
-#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24)
-#define EF_ARM_EABI_VERSION_UNKNOWN 0
-#define EF_ARM_EABI_FREEBSD_MIN 4
+#define EF_ARM_EABI_VERSION(x) (((x) & EF_ARM_EABIMASK) >> 24)
+#define EF_ARM_EABI_VERSION_UNKNOWN 0
+#define EF_ARM_EABI_FREEBSD_MIN 4
/*
* Magic number for the elf trampoline, chosen wisely to be an immediate
* value.
*/
-#define MAGIC_TRAMP_NUMBER 0x5c000003
+#define MAGIC_TRAMP_NUMBER 0x5c000003
-#define ET_DYN_LOAD_ADDR 0x12000
+#define ET_DYN_LOAD_ADDR 0x12000
#endif /* !_MACHINE_ELF_H_ */
Index: head/sys/kern/imgact_elf.c
===================================================================
--- head/sys/kern/imgact_elf.c
+++ head/sys/kern/imgact_elf.c
@@ -972,6 +972,7 @@
elf_auxargs->base = addr;
elf_auxargs->flags = 0;
elf_auxargs->entry = entry;
+ elf_auxargs->hdr_eflags = hdr->e_flags;
imgp->auxargs = elf_auxargs;
imgp->interpreted = 0;
@@ -1002,6 +1003,9 @@
AUXARGS_ENTRY(pos, AT_FLAGS, args->flags);
AUXARGS_ENTRY(pos, AT_ENTRY, args->entry);
AUXARGS_ENTRY(pos, AT_BASE, args->base);
+#ifdef AT_EHDREFLAGS
+ AUXARGS_ENTRY(pos, AT_EHDRFLAGS, args->hdr_eflags);
+#endif
if (imgp->execpathp != 0)
AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp);
AUXARGS_ENTRY(pos, AT_OSRELDATE,
Index: head/sys/sys/imgact_elf.h
===================================================================
--- head/sys/sys/imgact_elf.h
+++ head/sys/sys/imgact_elf.h
@@ -52,6 +52,7 @@
Elf_Size base;
Elf_Size flags;
Elf_Size entry;
+ Elf_Word hdr_eflags; /* e_flags field from ehdr */
} __ElfN(Auxargs);
typedef struct {

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 15, 10:34 AM (12 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25320135
Default Alt Text
D2611.id5576.diff (4 KB)

Event Timeline