cbfstool: move iself() to eflheaders.c

The only user of iself() was in elfheaders.c. Move it there,
and make it local to the compilation unit.

Change-Id: I0d919ce372f6e2fce75885fb4fcba20d985979b3
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/5369
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
Aaron Durbin 2014-03-05 12:01:36 -06:00 committed by Aaron Durbin
parent a983cea5b9
commit aa8784c2d1
3 changed files with 7 additions and 9 deletions

View File

@ -23,7 +23,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <libgen.h> #include <libgen.h>
#include "elf.h"
#include "common.h" #include "common.h"
#include "cbfs.h" #include "cbfs.h"
@ -137,12 +136,6 @@ uint32_t string_to_arch(const char *arch_string)
return ret; return ret;
} }
int iself(unsigned char *input)
{
Elf32_Ehdr *ehdr = (Elf32_Ehdr *) input;
return !memcmp(ehdr->e_ident, ELFMAG, 4);
}
static struct filetypes_t { static struct filetypes_t {
uint32_t type; uint32_t type;
const char *name; const char *name;

View File

@ -109,8 +109,6 @@ uint32_t string_to_arch(const char *arch_string);
#define ALIGN(val, by) (((val) + (by)-1)&~((by)-1)) #define ALIGN(val, by) (((val) + (by)-1)&~((by)-1))
int iself(unsigned char *input);
typedef void (*comp_func_ptr) (char *, int, char *, int *); typedef void (*comp_func_ptr) (char *, int, char *, int *);
typedef enum { CBFS_COMPRESS_NONE = 0, CBFS_COMPRESS_LZMA = 1 } comp_algo; typedef enum { CBFS_COMPRESS_NONE = 0, CBFS_COMPRESS_LZMA = 1 } comp_algo;

View File

@ -121,6 +121,13 @@
* in the buffer struct. * in the buffer struct.
*/ */
static int iself(const void *input)
{
const Elf32_Ehdr *ehdr = input;
return !memcmp(ehdr->e_ident, ELFMAG, 4);
}
/* Get the ident array, so we can figure out /* Get the ident array, so we can figure out
* endian-ness, word size, and in future other useful * endian-ness, word size, and in future other useful
* parameters * parameters