Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37403234
en ru br
ALT Linux repos
S:5.45-alt1
D:4.20-alt5.1
5.0: 4.26-alt2
4.1: 4.20-alt5
4.0: 4.20-alt5
3.0: 4.13-alt1

Other repositories
Upstream:4.23

Group :: File tools
RPM: file

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: file-4.10-rh-alt-elf.patch
Download


diff -uprk.orig file-4.10.orig/magic/Magdir/elf file-4.10/magic/Magdir/elf
--- file-4.10.orig/magic/Magdir/elf	2003-05-24 01:37:35 +0400
+++ file-4.10/magic/Magdir/elf	2004-10-17 01:16:52 +0400
@@ -98,7 +98,7 @@
 >>18	leshort		47		Hitachi H8/300H,
 >>18	leshort		48		Hitachi H8S,
 >>18	leshort		49		Hitachi H8/500,
->>18	leshort		50		IA-64 (Intel 64 bit architecture)
+>>18	leshort		50		IA-64,
 >>18	leshort		51		Stanford MIPS-X,
 >>18	leshort		52		Motorola Coldfire,
 >>18	leshort		53		Motorola M68HC12,
@@ -186,7 +186,7 @@
 >>18	beshort		47		Hitachi H8/300H,
 >>18	beshort		48		Hitachi H8S,
 >>18	beshort		49		Hitachi H8/500,
->>18	beshort		50		Intel Merced Processor,
+>>18	beshort		50		IA-64,
 >>18	beshort		51		Stanford MIPS-X,
 >>18	beshort		52		Motorola Coldfire,
 >>18	beshort		53		Motorola M68HC12,
diff -uprk.orig file-4.10.orig/src/readelf.c file-4.10/src/readelf.c
--- file-4.10.orig/src/readelf.c	2004-07-25 00:57:22 +0400
+++ file-4.10/src/readelf.c	2004-10-17 01:17:24 +0400
@@ -750,7 +750,7 @@ file_tryelf(struct magic_set *ms, int fd
 	    return 0;
 
 
-	class = buf[4];
+	class = buf[EI_CLASS];
 
 	if (class == ELFCLASS32) {
 		Elf32_Ehdr elfhdr;
@@ -760,7 +760,7 @@ file_tryelf(struct magic_set *ms, int fd
 
 		u.l = 1;
 		(void) memcpy(&elfhdr, buf, sizeof elfhdr);
-		swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[5];
+		swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[EI_DATA];
 
 		if (getu16(swap, elfhdr.e_type) == ET_CORE) {
 #ifdef ELFCORE
@@ -798,7 +798,7 @@ file_tryelf(struct magic_set *ms, int fd
 
 		u.l = 1;
 		(void) memcpy(&elfhdr, buf, sizeof elfhdr);
-		swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[5];
+		swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[EI_DATA];
 
 		if (getu16(swap, elfhdr.e_type) == ET_CORE) {
 #ifdef ELFCORE
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin