Commit dbef13b8 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] Fill in ELF OSABI in ELF headers

This fills in the ELF EI_OSABI field.  This doesn't matter for most
architectures, but PA-RISC uses the Linux flavour of the ABI (since HPUX
uses the None flavour).

Patch by Randolph Chung.
parent b11a8558
......@@ -1088,6 +1088,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
elf.e_ident[EI_CLASS] = ELFCLASS32;
elf.e_ident[EI_DATA] = ELFDATA2LSB;
elf.e_ident[EI_VERSION] = EV_CURRENT;
elf.e_ident[EI_OSABI] = ELF_OSABI;
memset(elf.e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
elf.e_type = ET_CORE;
......
......@@ -1023,6 +1023,7 @@ static inline void fill_elf_header(struct elfhdr *elf, int segs)
elf->e_ident[EI_CLASS] = ELF_CLASS;
elf->e_ident[EI_DATA] = ELF_DATA;
elf->e_ident[EI_VERSION] = EV_CURRENT;
elf->e_ident[EI_OSABI] = ELF_OSABI;
memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
elf->e_type = ET_CORE;
......
......@@ -175,6 +175,7 @@ static void elf_kcore_store_hdr(char *bufp, int nphdr, int dataoff)
elf->e_ident[EI_CLASS] = ELF_CLASS;
elf->e_ident[EI_DATA] = ELF_DATA;
elf->e_ident[EI_VERSION]= EV_CURRENT;
elf->e_ident[EI_OSABI] = ELF_OSABI;
memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
elf->e_type = ET_CORE;
elf->e_machine = ELF_ARCH;
......
......@@ -360,7 +360,8 @@ typedef struct elf64_shdr {
#define EI_CLASS 4
#define EI_DATA 5
#define EI_VERSION 6
#define EI_PAD 7
#define EI_OSABI 7
#define EI_PAD 8
#define ELFMAG0 0x7f /* EI_MAG */
#define ELFMAG1 'E'
......@@ -382,6 +383,13 @@ typedef struct elf64_shdr {
#define EV_CURRENT 1
#define EV_NUM 2
#define ELFOSABI_NONE 0
#define ELFOSABI_LINUX 3
#ifndef ELF_OSABI
#define ELF_OSABI ELFOSABI_NONE
#endif
/* Notes used in ET_CORE */
#define NT_PRSTATUS 1
#define NT_PRFPREG 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment