This fixes compiler warnings with
-O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector \
-fno-builtin-memset -fno-strict-aliasing
Yes, for the one in get_lkcd_regs_for_cpu_v8() you can blame myself.
Signed-off-by: Bernhard Walle <bwalle(a)suse.de>
---
lkcd_common.c | 2 +-
lkcd_v8.c | 4 +---
symbols.c | 3 +++
3 files changed, 5 insertions(+), 4 deletions(-)
--- a/lkcd_common.c
+++ b/lkcd_common.c
@@ -1265,7 +1265,7 @@ lkcd_uncompress_gzip(unsigned char *dest
unsigned char *source, ulong sourcelen)
{
ulong retlen = destlen;
- int rc;
+ int rc = FALSE;
switch (uncompress(dest, &retlen, source, sourcelen))
{
--- a/lkcd_v8.c
+++ b/lkcd_v8.c
@@ -71,7 +71,7 @@ get_lkcd_regs_for_cpu_arch(int cpu, ulon
int
get_lkcd_regs_for_cpu_v8(struct bt_info *bt, ulong *eip, ulong *esp)
{
- int cpu;
+ int cpu = bt->tc->processor;
if (!bt || !bt->tc) {
fprintf(stderr, "get_lkcd_regs_for_cpu_v8: invalid tc "
@@ -79,8 +79,6 @@ get_lkcd_regs_for_cpu_v8(struct bt_info
return -EINVAL;
}
- cpu = bt->tc->processor;
-
if (cpu >= NR_CPUS) {
fprintf(stderr, "get_lkcd_regs_for_cpu_v8, cpu (%d) too high\n", cpu);
return -EINVAL;
--- a/symbols.c
+++ b/symbols.c
@@ -7538,6 +7538,9 @@ calculate_load_order_v2(struct load_modu
char *secname;
int i;
+ if ((store = bfd_make_empty_symbol(bfd)) == NULL)
+ error(FATAL, "bfd_make_empty_symbol() failed\n");
+
s1 = lm->mod_symtable;
s2 = lm->mod_symend;
while (s1 < s2) {