diff -Naurp arcload-0.5.orig/arcgrub/Makefile arcload-0.5/arcgrub/Makefile --- arcload-0.5.orig/arcgrub/Makefile 2006-01-17 22:43:17.000000000 -0500 +++ arcload-0.5/arcgrub/Makefile 2009-03-01 20:34:01.258690486 -0500 @@ -2,11 +2,19 @@ # Copyright 2004 Stanislaw Skowronek # ifeq ($(MODE),M32) -CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -I. -D$(MODE) +CFLAGS = -O -march=mips3 -mabi=32 \ + -Wall -Wno-pointer-sign \ + -mno-abicalls -G 0 -fno-pic -fno-builtin \ + -I.. -I. \ + -D$(MODE) ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic -D$(MODE) OUTPUTFMT = elf32-tradbigmips else -CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -I. -D$(MODE) +CFLAGS = -O -march=mips3 -mabi=64 \ + -Wall -Wno-pointer-sign \ + -mno-abicalls -G 0 -fno-pic -fno-builtin \ + -I.. -I. \ + -D$(MODE) ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic -D$(MODE) OUTPUTFMT = elf64-tradbigmips endif diff -Naurp arcload-0.5.orig/arclib/Makefile arcload-0.5/arclib/Makefile --- arcload-0.5.orig/arclib/Makefile 2006-01-19 23:09:21.000000000 -0500 +++ arcload-0.5/arclib/Makefile 2009-03-01 20:35:21.407711034 -0500 @@ -2,11 +2,19 @@ # Copyright 1999 Silicon Graphics, Inc. # ifeq ($(MODE),M32) -CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE) +CFLAGS = -O -march=mips3 -mabi=32 \ + -Wall -Wno-pointer-sign \ + -mno-abicalls -G 0 -fno-pic -fno-builtin \ + -I.. \ + -D$(MODE) ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic OUTPUTFMT = elf32-tradbigmips else -CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE) +CFLAGS = -O -march=mips3 -mabi=64 \ + -Wall -Wno-pointer-sign \ + -mno-abicalls -G 0 -fno-pic -fno-builtin \ + -I.. \ + -D$(MODE) ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic OUTPUTFMT = elf64-tradbigmips endif diff -Naurp arcload-0.5.orig/ecoff/Makefile arcload-0.5/ecoff/Makefile --- arcload-0.5.orig/ecoff/Makefile 2005-05-31 03:08:10.000000000 -0400 +++ arcload-0.5/ecoff/Makefile 2009-03-01 20:31:38.246701883 -0500 @@ -5,7 +5,7 @@ all: wreckoff wreckoff: ecoff.h elf32.h endian.h list.h wreckoff.c - $(CC) -o $@ -O2 -Wall wreckoff.c -I.. + $(CC) -o $@ -O2 -Wall -Wno-pointer-sign wreckoff.c -I.. clean: rm -f wreckoff diff -Naurp arcload-0.5.orig/ecoff/wreckoff.c arcload-0.5/ecoff/wreckoff.c --- arcload-0.5.orig/ecoff/wreckoff.c 2005-05-31 03:30:28.000000000 -0400 +++ arcload-0.5/ecoff/wreckoff.c 2009-03-01 20:31:38.246701883 -0500 @@ -112,6 +112,7 @@ void synthesize_ecoff(FILE *f) int i, nsyms, nscns, vptr, rptr, sptr, align; int strsize, sym_sc = scNil, sym_st = 0; char *strtab; + size_t ret = 0; /* reindex sections and symbols */ nscns = 0; @@ -151,7 +152,7 @@ void synthesize_ecoff(FILE *f) fhdr.f_opthdr = 56; fhdr.f_flags = (F_EXEC | F_MIPS_NO_REORG); swap_filehdr(&fhdr); - fwrite(&fhdr, sizeof(struct filehdr), 1, f); + ret = fwrite(&fhdr, sizeof(struct filehdr), 1, f); /* write a.out header */ ahdr.magic = OMAGIC; @@ -196,7 +197,7 @@ void synthesize_ecoff(FILE *f) ahdr.gp_value = reginfo.ri_gp_value; swap_aouthdr(&ahdr); - fwrite(&ahdr, sizeof(struct aouthdr), 1, f); + ret = fwrite(&ahdr, sizeof(struct aouthdr), 1, f); LIST_FOR(section, sections) { strncpy(shdr.s_name, section->name, 8); @@ -229,23 +230,23 @@ void synthesize_ecoff(FILE *f) shdr.s_flags = STYP_BSS; swap_scnhdr(&shdr); - fwrite(&shdr, sizeof(struct scnhdr), 1, f); + ret = fwrite(&shdr, sizeof(struct scnhdr), 1, f); } i = 0; while(align--) - fwrite(&i, 1, 1, f); + ret = fwrite(&i, 1, 1, f); /* save section contents */ LIST_FOR(section, sections) if(section->data) { if(section->gccfix) { - fwrite(section->data, (section->size - 0x10), 1, f); + ret = fwrite(section->data, (section->size - 0x10), 1, f); align = 0; for(i = 0; i < 4; i++) - fwrite(&align, 4, 1, f); + ret = fwrite(&align, 4, 1, f); } else - fwrite(section->data, section->size, 1, f); + ret = fwrite(section->data, section->size, 1, f); } /* save section relocs */ @@ -275,7 +276,7 @@ void synthesize_ecoff(FILE *f) rhdr.r_vaddr = reloc->offset; rhdr.r = R_R(reloc->sym->index, i, 1); swap_reloc(&rhdr); - fwrite(&rhdr, sizeof(struct reloc), 1, f); + ret = fwrite(&rhdr, sizeof(struct reloc), 1, f); } /* create strtab */ @@ -302,10 +303,10 @@ void synthesize_ecoff(FILE *f) ghdr.iextMax = nsyms; ghdr.cbExtOffset = (sptr + sizeof(struct sgihdrr) + strsize); swap_sgihdrr(&ghdr); - fwrite(&ghdr, sizeof(struct sgihdrr), 1, f); + ret = fwrite(&ghdr, sizeof(struct sgihdrr), 1, f); /* save strtab */ - fwrite(strtab, strsize, 1, f); + ret = fwrite(strtab, strsize, 1, f); /* save symbols */ LIST_FOR(symbol, symbols) @@ -331,7 +332,7 @@ void synthesize_ecoff(FILE *f) mhdr.value = symbol->offset; mhdr.data = S_DATA(sym_st, sym_sc, 0xFFFFF); swap_sgiextr(&mhdr); - fwrite(&mhdr, sizeof(struct sgiextr), 1, f); + ret = fwrite(&mhdr, sizeof(struct sgiextr), 1, f); } } @@ -340,8 +341,9 @@ void synthesize_ecoff(FILE *f) char *load_strtab(FILE *f, unsigned off, int sz) { char *p = malloc(sz); + size_t ret = 0; fseek(f, off, SEEK_SET); - fread(p, sz, 1, f); + ret = fread(p, sz, 1, f); return p; } @@ -359,13 +361,14 @@ void analyze_elf32(FILE *f) struct Reloc *reloc; int i, j, symtab; char **strtabs, **shnames; + size_t ret = 0; LIST_INIT(sections); LIST_INIT(symbols); /* load ELF header */ fseek(f, 0, SEEK_SET); - fread(&ehdr, sizeof(Elf32_Ehdr), 1, f); + ret = fread(&ehdr, sizeof(Elf32_Ehdr), 1, f); swap_Ehdr(&ehdr); for(i = 0; i < 6; i++) if(ehdr.e_ident[i] != elf32_ident[i]) @@ -379,7 +382,7 @@ void analyze_elf32(FILE *f) strtabs = calloc(sizeof(char *), ehdr.e_shnum); for(i = 0; i < ehdr.e_shnum; i++) { fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET); - fread(&shdr, sizeof(Elf32_Shdr), 1, f); + ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f); swap_Shdr(&shdr); if(shdr.sh_type == SHT_STRTAB) @@ -396,14 +399,14 @@ void analyze_elf32(FILE *f) shnames=calloc(sizeof(char *),ehdr.e_shnum); for(i = 0; i < ehdr.e_shnum; i++) { fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET); - fread(&shdr, sizeof(Elf32_Shdr), 1, f); + ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f); swap_Shdr(&shdr); shnames[i] = (strtabs[ehdr.e_shstrndx] + shdr.sh_name); if((shdr.sh_flags & SHF_ALLOC)) { if(shdr.sh_type == SHT_REGINFO) { fseek(f, shdr.sh_offset, SEEK_SET); - fread(®info, sizeof(Elf32_RegInfo), 1, f); + ret = fread(®info, sizeof(Elf32_RegInfo), 1, f); swap_RegInfo(®info); continue; } @@ -436,7 +439,7 @@ void analyze_elf32(FILE *f) /* load symbols */ if(symtab != -1) { fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * symtab)), SEEK_SET); - fread(&shdr, sizeof(Elf32_Shdr), 1, f); + ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f); swap_Shdr(&shdr); if(!shdr.sh_entsize) @@ -447,7 +450,7 @@ void analyze_elf32(FILE *f) for( i = 0; i < (shdr.sh_size / shdr.sh_entsize); i++) { fseek(f, (shdr.sh_offset + (shdr.sh_entsize * i)), SEEK_SET); - fread(&mhdr, sizeof(Elf32_Sym), 1, f); + ret = fread(&mhdr, sizeof(Elf32_Sym), 1, f); swap_Sym(&mhdr); symbol = calloc(sizeof(struct Symbol), 1); symbol->name = (strtabs[shdr.sh_link] + mhdr.st_name); @@ -470,7 +473,7 @@ void analyze_elf32(FILE *f) /* load rels and decompose relas */ for(i = 0; i < ehdr.e_shnum; i++) { fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET); - fread(&shdr, sizeof(Elf32_Shdr), 1, f); + ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f); swap_Shdr(&shdr); if((shdr.sh_type != SHT_REL) && (shdr.sh_type != SHT_RELA)) @@ -491,13 +494,13 @@ void analyze_elf32(FILE *f) fseek(f, (shdr.sh_offset + (shdr.sh_entsize * j)), SEEK_SET); if(shdr.sh_type == SHT_REL) { - fread(&qhdr, sizeof(Elf32_Rel), 1, f); + ret = fread(&qhdr, sizeof(Elf32_Rel), 1, f); swap_Rel(&qhdr); rhdr.r_offset = qhdr.r_offset; rhdr.r_info = qhdr.r_info; rhdr.r_addend = 0; } else { - fread(&rhdr, sizeof(Elf32_Rela), 1, f); + ret = fread(&rhdr, sizeof(Elf32_Rela), 1, f); swap_Rela(&rhdr); } diff -Naurp arcload-0.5.orig/loader/Makefile arcload-0.5/loader/Makefile --- arcload-0.5.orig/loader/Makefile 2006-01-19 23:10:04.000000000 -0500 +++ arcload-0.5/loader/Makefile 2009-03-01 20:37:21.376720711 -0500 @@ -2,12 +2,20 @@ # Copyright 2004 Stanislaw Skowronek # ifeq ($(MODE),M32) -CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE) +CFLAGS = -O -march=mips3 -mabi=32 \ + -Wall -Wno-pointer-sign \ + -mno-abicalls -G 0 -fno-pic -fno-builtin \ + -I.. \ + -D$(MODE) ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic -D$(MODE) OUTPUTFMT = elf32-tradbigmips TARGET = ../arcload.ecoff else -CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE) +CFLAGS = -O -march=mips3 -mabi=64 \ + -Wall -Wno-pointer-sign \ + -mno-abicalls -G 0 -fno-pic -fno-builtin \ + -I.. \ + -D$(MODE) ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic -D$(MODE) OUTPUTFMT = elf64-tradbigmips TARGET = ../arcload