summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-03-26 19:40:39 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-03-26 19:40:39 +0000
commit65ebd664a047ca688e0586251f9a2aa26e8f9990 (patch)
tree15de011302565c9e1f2f475667669dd464c31113
parent30c6496f51c340f8fba2bc372ede68b01c0439c3 (diff)
- fixup stripping of host utils and make host-utils compile with std=gnu99
-rw-r--r--Makerules3
-rw-r--r--utils/ldd.c12
-rw-r--r--utils/readelf.c14
3 files changed, 14 insertions, 15 deletions
diff --git a/Makerules b/Makerules
index a5ef1882c..fc6b37ddc 100644
--- a/Makerules
+++ b/Makerules
@@ -120,8 +120,7 @@ do_ar = @$(disp_ar) ; $(cmd_ar)
define compile.u
@$(disp_compile.u) ; $(cmd_compile.u)
- @$(disp_strip)
- $(Q)$(STRIPTOOL) $(STRIP_FLAGS) $@
+ @$(disp_t_strip)
endef
hcompile.u = $(HOSTCC) $^ $(DEPS-$(notdir $@)) -o $@ $(BUILD_LDFLAGS) $(BUILD_LDFLAGS-$(notdir $(^D))) $(BUILD_LDFLAGS-$(notdir $@)) $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@))
hcompile.o = $(HOSTCC) $^ $(DEPS-$(notdir $@)) -c -o $@ $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@))
diff --git a/utils/ldd.c b/utils/ldd.c
index e11760a1a..a00bc3ba4 100644
--- a/utils/ldd.c
+++ b/utils/ldd.c
@@ -155,10 +155,10 @@ struct library *lib_list = NULL;
char not_found[] = "not found";
char *interp_name = NULL;
char *interp_dir = NULL;
-int byteswap;
+static int byteswap;
static int interpreter_already_found = 0;
-inline uint32_t byteswap32_to_host(uint32_t value)
+static inline uint32_t byteswap32_to_host(uint32_t value)
{
if (byteswap == 1) {
return (bswap_32(value));
@@ -166,7 +166,7 @@ inline uint32_t byteswap32_to_host(uint32_t value)
return (value);
}
}
-inline uint64_t byteswap64_to_host(uint64_t value)
+static inline uint64_t byteswap64_to_host(uint64_t value)
{
if (byteswap == 1) {
return (bswap_64(value));
@@ -181,7 +181,7 @@ inline uint64_t byteswap64_to_host(uint64_t value)
# define byteswap_to_host(x) byteswap64_to_host(x)
#endif
-ElfW(Shdr) *elf_find_section_type(uint32_t key, ElfW(Ehdr) *ehdr)
+static ElfW(Shdr) *elf_find_section_type(uint32_t key, ElfW(Ehdr) *ehdr)
{
int j;
ElfW(Shdr) *shdr;
@@ -194,7 +194,7 @@ ElfW(Shdr) *elf_find_section_type(uint32_t key, ElfW(Ehdr) *ehdr)
return NULL;
}
-ElfW(Phdr) *elf_find_phdr_type(uint32_t type, ElfW(Ehdr) *ehdr)
+static ElfW(Phdr) *elf_find_phdr_type(uint32_t type, ElfW(Ehdr) *ehdr)
{
int j;
ElfW(Phdr) *phdr = (ElfW(Phdr) *) (ehdr->e_phoff + (char *)ehdr);
@@ -207,7 +207,7 @@ ElfW(Phdr) *elf_find_phdr_type(uint32_t type, ElfW(Ehdr) *ehdr)
}
/* Returns value if return_val==1, ptr otherwise */
-void *elf_find_dynamic(int64_t const key, ElfW(Dyn) *dynp,
+static void *elf_find_dynamic(int64_t const key, ElfW(Dyn) *dynp,
ElfW(Ehdr) *ehdr, int return_val)
{
ElfW(Phdr) *pt_text = elf_find_phdr_type(PT_LOAD, ehdr);
diff --git a/utils/readelf.c b/utils/readelf.c
index 0ff5d2563..3349fa129 100644
--- a/utils/readelf.c
+++ b/utils/readelf.c
@@ -27,8 +27,8 @@
#include "link.h"
/* makefile will include elf.h for us */
-int byteswap;
-inline uint32_t byteswap32_to_host(uint32_t value)
+static int byteswap;
+static inline uint32_t byteswap32_to_host(uint32_t value)
{
if (byteswap==1) {
return(bswap_32(value));
@@ -36,7 +36,7 @@ inline uint32_t byteswap32_to_host(uint32_t value)
return(value);
}
}
-inline uint64_t byteswap64_to_host(uint64_t value)
+static inline uint64_t byteswap64_to_host(uint64_t value)
{
if (byteswap==1) {
return(bswap_64(value));
@@ -50,7 +50,7 @@ inline uint64_t byteswap64_to_host(uint64_t value)
# define byteswap_to_host(x) byteswap32_to_host(x)
#endif
-ElfW(Shdr) * elf_find_section_type( uint32_t key, ElfW(Ehdr) *ehdr)
+static ElfW(Shdr) * elf_find_section_type( uint32_t key, ElfW(Ehdr) *ehdr)
{
int j;
ElfW(Shdr) *shdr = (ElfW(Shdr) *)(ehdr->e_shoff + (char *)ehdr);
@@ -62,7 +62,7 @@ ElfW(Shdr) * elf_find_section_type( uint32_t key, ElfW(Ehdr) *ehdr)
return NULL;
}
-ElfW(Phdr) * elf_find_phdr_type( uint32_t type, ElfW(Ehdr) *ehdr)
+static ElfW(Phdr) * elf_find_phdr_type( uint32_t type, ElfW(Ehdr) *ehdr)
{
int j;
ElfW(Phdr) *phdr = (ElfW(Phdr) *)(ehdr->e_phoff + (char *)ehdr);
@@ -75,7 +75,7 @@ ElfW(Phdr) * elf_find_phdr_type( uint32_t type, ElfW(Ehdr) *ehdr)
}
/* Returns value if return_val==1, ptr otherwise */
-void * elf_find_dynamic( int64_t const key, ElfW(Dyn) *dynp,
+static void * elf_find_dynamic( int64_t const key, ElfW(Dyn) *dynp,
ElfW(Ehdr) *ehdr, int return_val)
{
ElfW(Phdr) *pt_text = elf_find_phdr_type(PT_LOAD, ehdr);
@@ -91,7 +91,7 @@ void * elf_find_dynamic( int64_t const key, ElfW(Dyn) *dynp,
return NULL;
}
-int check_elf_header(ElfW(Ehdr) *const ehdr)
+static int check_elf_header(ElfW(Ehdr) *const ehdr)
{
if (! ehdr || strncmp((void *)ehdr, ELFMAG, SELFMAG) != 0 ||
(ehdr->e_ident[EI_CLASS] != ELFCLASS32 &&