* aout-adobe.c, aoutf1.h, aoutx.h, bout.c coff-m68k.c, coff-z8k.c,

coffcode.h, elf.c, libaout.h, libbfd.h, srec.c:  Lint.
This commit is contained in:
John Gilmore 1992-10-15 09:44:59 +00:00
parent f8e0194018
commit 5f9ca96038
9 changed files with 37 additions and 55 deletions

View file

@ -5,6 +5,9 @@ Thu Oct 15 01:32:22 1992 John Gilmore (gnu@cygnus.com)
sco-core.c: Lint: Second argument of bfd_seek is always file_ptr. sco-core.c: Lint: Second argument of bfd_seek is always file_ptr.
Third argument is SEEK_SET or SEEK_CUR. Result is always 0 or -1. Third argument is SEEK_SET or SEEK_CUR. Result is always 0 or -1.
* aout-adobe.c, aoutf1.h, aoutx.h, bout.c coff-m68k.c, coff-z8k.c,
coffcode.h, elf.c, libaout.h, libbfd.h, srec.c: Lint.
Fri Oct 9 03:46:37 1992 John Gilmore (gnu@cygnus.com) Fri Oct 9 03:46:37 1992 John Gilmore (gnu@cygnus.com)
* configure.host: New file, contains mapping of host configs * configure.host: New file, contains mapping of host configs

View file

@ -141,7 +141,6 @@ DEFUN(NAME(aout,sunos4_write_object_contents),
(abfd), (abfd),
bfd *abfd) bfd *abfd)
{ {
bfd_size_type data_pad = 0;
struct external_exec exec_bytes; struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd); struct internal_exec *execp = exec_hdr (abfd);

View file

@ -827,7 +827,6 @@ DEFUN (NAME (aout,adjust_sizes_and_vmas), (abfd, text_size, text_end),
break; break;
case n_magic: case n_magic:
{ {
CONST struct aout_backend_data *abdp;
file_ptr pos = adata(abfd).exec_bytes_size; file_ptr pos = adata(abfd).exec_bytes_size;
bfd_vma vma = 0; bfd_vma vma = 0;
int pad; int pad;

View file

@ -888,6 +888,7 @@ DEFUN(get_value,(reloc, seclet),
{ {
bfd_vma value; bfd_vma value;
asymbol *symbol = *(reloc->sym_ptr_ptr); asymbol *symbol = *(reloc->sym_ptr_ptr);
/* A symbol holds a pointer to a section, and an offset from the /* A symbol holds a pointer to a section, and an offset from the
base of the section. To relocate, we find where the section will base of the section. To relocate, we find where the section will
live in the output and add that in */ live in the output and add that in */
@ -905,7 +906,6 @@ DEFUN(get_value,(reloc, seclet),
symbol->section->output_section->vma; symbol->section->output_section->vma;
} }
/* Add the value contained in the relocation */ /* Add the value contained in the relocation */
value += (short)((reloc->addend) & 0xffff); value += (short)((reloc->addend) & 0xffff);
@ -962,7 +962,6 @@ DEFUN(abs32code,(input_section, symbols, r, shrink),
if (-1<<23 < (long)gap && (long)gap < 1<<23 ) if (-1<<23 < (long)gap && (long)gap < 1<<23 )
{ {
/* Change the reloc type from 32bitcode possible 24, to 24bit /* Change the reloc type from 32bitcode possible 24, to 24bit
possible 32 */ possible 32 */
@ -973,8 +972,6 @@ DEFUN(abs32code,(input_section, symbols, r, shrink),
/* This will be four bytes smaller in the long run */ /* This will be four bytes smaller in the long run */
shrink += 4 ; shrink += 4 ;
perform_slip(symbols, 4, input_section, r->address-shrink +4); perform_slip(symbols, 4, input_section, r->address-shrink +4);
} }
return shrink; return shrink;
} }
@ -986,20 +983,17 @@ DEFUN(aligncode,(input_section, symbols, r, shrink),
arelent *r AND arelent *r AND
unsigned int shrink) unsigned int shrink)
{ {
bfd_vma value = get_value(r,0);
bfd_vma dot = input_section->output_section->vma + input_section->output_offset + r->address; bfd_vma dot = input_section->output_section->vma + input_section->output_offset + r->address;
bfd_vma gap; bfd_vma gap;
bfd_vma old_end; bfd_vma old_end;
bfd_vma new_end; bfd_vma new_end;
int shrink_delta; int shrink_delta;
int size = r->howto->size; int size = r->howto->size;
/* Reduce the size of the alignment so that it's still aligned but /* Reduce the size of the alignment so that it's still aligned but
smaller - the current size is already the same size as or bigger smaller - the current size is already the same size as or bigger
than the alignment required. */ than the alignment required. */
/* calculate the first byte following the padding before we optimize */ /* calculate the first byte following the padding before we optimize */
old_end = ((dot + size ) & ~size) + size+1; old_end = ((dot + size ) & ~size) + size+1;
/* work out where the new end will be - remember that we're smaller /* work out where the new end will be - remember that we're smaller
@ -1013,7 +1007,6 @@ int size = r->howto->size;
if (shrink_delta) if (shrink_delta)
{ {
/* Change the reloc so that it knows how far to align to */ /* Change the reloc so that it knows how far to align to */
r->howto = howto_done_align_table + (r->howto - howto_align_table); r->howto = howto_done_align_table + (r->howto - howto_align_table);
@ -1022,9 +1015,6 @@ int size = r->howto->size;
r->addend = old_end ; r->addend = old_end ;
/* This will be N bytes smaller in the long run, adjust all the symbols */ /* This will be N bytes smaller in the long run, adjust all the symbols */
perform_slip(symbols, shrink_delta, input_section, r->address - shrink ); perform_slip(symbols, shrink_delta, input_section, r->address - shrink );
shrink += shrink_delta; shrink += shrink_delta;
} }

View file

@ -44,22 +44,21 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define BADMAG(x) M68KBADMAG(x) #define BADMAG(x) M68KBADMAG(x)
#define M68 1 /* Customize coffcode.h */ #define M68 1 /* Customize coffcode.h */
void
m68k_rtype2howto(internal, relocentry) m68k_rtype2howto(internal, relocentry)
arelent *internal; arelent *internal;
int relocentry; int relocentry;
{ {
switch (relocentry) switch (relocentry)
{ {
case R_RELBYTE: (internal)->howto = ( m68kcoff_howto_table + 0);break; case R_RELBYTE: internal->howto = m68kcoff_howto_table + 0; break;
case R_RELWORD: (internal)->howto = ( m68kcoff_howto_table + 1);break; case R_RELWORD: internal->howto = m68kcoff_howto_table + 1; break;
case R_RELLONG: (internal)->howto = ( m68kcoff_howto_table + 2);break; case R_RELLONG: internal->howto = m68kcoff_howto_table + 2; break;
case R_PCRBYTE: (internal)->howto = ( m68kcoff_howto_table + 3);break; case R_PCRBYTE: internal->howto = m68kcoff_howto_table + 3; break;
case R_PCRWORD: (internal)->howto = ( m68kcoff_howto_table + 4);break; case R_PCRWORD: internal->howto = m68kcoff_howto_table + 4; break;
case R_PCRLONG: (internal)->howto = ( m68kcoff_howto_table + 5);break; case R_PCRLONG: internal->howto = m68kcoff_howto_table + 5; break;
case R_RELLONG_NEG: (internal)->howto = ( m68kcoff_howto_table + 6);break; case R_RELLONG_NEG: internal->howto = m68kcoff_howto_table + 6; break;
} }
} }
#define RTYPE2HOWTO(internal, relocentry) m68k_rtype2howto(internal, (relocentry)->r_type) #define RTYPE2HOWTO(internal, relocentry) m68k_rtype2howto(internal, (relocentry)->r_type)

View file

@ -151,7 +151,8 @@ static void DEFUN(reloc_processing,(relent,reloc, symbols, abfd, section) ,
} }
static bfd_vma get_value(); static bfd_vma get_value();
static
static void
extra_case(in_abfd, seclet, reloc, data, src_ptr, dst_ptr) extra_case(in_abfd, seclet, reloc, data, src_ptr, dst_ptr)
bfd *in_abfd; bfd *in_abfd;
bfd_seclet_type *seclet; bfd_seclet_type *seclet;

View file

@ -2315,7 +2315,6 @@ coff_add_missing_symbols (abfd)
asymbol **sympp2; asymbol **sympp2;
unsigned int i; unsigned int i;
int need_text = 1, need_data = 1, need_bss = 1, need_file = 1; int need_text = 1, need_data = 1, need_bss = 1, need_file = 1;
coff_data_type *cdata = coff_data (abfd);
for (i = 0; i < nsyms; i++) for (i = 0; i < nsyms; i++)
{ {

View file

@ -476,7 +476,6 @@ DEFUN(bfd_section_from_shdr, (abfd, shindex),
{ {
asection *target_sect; asection *target_sect;
unsigned int idx;
bfd_section_from_shdr (abfd, hdr->sh_link); /* symbol table */ bfd_section_from_shdr (abfd, hdr->sh_link); /* symbol table */
bfd_section_from_shdr (abfd, hdr->sh_info); /* target */ bfd_section_from_shdr (abfd, hdr->sh_info); /* target */
@ -1047,7 +1046,6 @@ DEFUN (elf_object_p, (abfd), bfd *abfd)
Elf_Internal_Shdr *i_shdrp; /* Section header table, internal form */ Elf_Internal_Shdr *i_shdrp; /* Section header table, internal form */
int shindex; int shindex;
char *shstrtab; /* Internal copy of section header stringtab */ char *shstrtab; /* Internal copy of section header stringtab */
Elf_Off offset; /* Temp place to stash file offsets */
/* Read in the ELF header in external format. */ /* Read in the ELF header in external format. */
@ -1910,7 +1908,6 @@ DEFUN (elf_slurp_symbol_table, (abfd, symptrs),
Elf_Internal_Shdr *hdr = i_shdrp + elf_onesymtab (abfd); Elf_Internal_Shdr *hdr = i_shdrp + elf_onesymtab (abfd);
int symcount; /* Number of external ELF symbols */ int symcount; /* Number of external ELF symbols */
int i; int i;
char *strtab; /* Buffer for raw ELF string table section */
asymbol *sym; /* Pointer to current bfd symbol */ asymbol *sym; /* Pointer to current bfd symbol */
asymbol *symbase; /* Buffer for generated bfd symbols */ asymbol *symbase; /* Buffer for generated bfd symbols */
Elf_Internal_Sym i_sym; Elf_Internal_Sym i_sym;
@ -2206,7 +2203,6 @@ DEFUN(elf_slurp_reloca_table,(abfd, asect, symbols),
RELOC_PROCESSING(cache_ptr, &dst, symbols, abfd, asect); RELOC_PROCESSING(cache_ptr, &dst, symbols, abfd, asect);
#else #else
Elf_Internal_Rela dst; Elf_Internal_Rela dst;
asymbol *ptr;
Elf_External_Rela *src; Elf_External_Rela *src;
cache_ptr = reloc_cache + idx; cache_ptr = reloc_cache + idx;
@ -2227,7 +2223,6 @@ DEFUN(elf_slurp_reloca_table,(abfd, asect, symbols),
/* ELF_R_SYM(dst.r_info) is the symbol table offset... */ /* ELF_R_SYM(dst.r_info) is the symbol table offset... */
cache_ptr->sym_ptr_ptr = symbols + ELF_R_SYM(dst.r_info); cache_ptr->sym_ptr_ptr = symbols + ELF_R_SYM(dst.r_info);
cache_ptr->addend = dst.r_addend; cache_ptr->addend = dst.r_addend;
/* ptr = *(cache_ptr->sym_ptr_ptr); */
/* Fill in the cache_ptr->howto field from dst.r_type */ /* Fill in the cache_ptr->howto field from dst.r_type */
elf_info_to_howto(abfd, cache_ptr, &dst); elf_info_to_howto(abfd, cache_ptr, &dst);
@ -2269,8 +2264,6 @@ DEFUN (elf_get_symtab, (abfd, alocation),
bfd *abfd AND bfd *abfd AND
asymbol **alocation) asymbol **alocation)
{ {
unsigned int symcount;
asymbol **vec;
if (!elf_slurp_symbol_table (abfd, alocation)) if (!elf_slurp_symbol_table (abfd, alocation))
return (0); return (0);

View file

@ -76,20 +76,20 @@ DESCRIPTION
#include "sysdep.h" #include "sysdep.h"
#include "libbfd.h" #include "libbfd.h"
static char digs[] = "0123456789ABCDEF"; /* Macros for converting between hex and binary */
/* Horrible ascii dependent macros for converting between hex and static const char digs[] = "0123456789ABCDEF";
binary */
static char hex_value[1 + (unsigned char)~0];
#define CHARS_IN_SET 256
static char hex_value[CHARS_IN_SET];
#define NOT_HEX 20 #define NOT_HEX 20
#define NIBBLE(x) hex_value[x] #define NIBBLE(x) hex_value[(unsigned char)(x)]
#define HEX(buffer) ((NIBBLE((buffer)[0])<<4) + NIBBLE((buffer)[1])) #define HEX(buffer) ((NIBBLE((buffer)[0])<<4) + NIBBLE((buffer)[1]))
#define TOHEX(d, x, ch) \ #define TOHEX(d, x, ch) \
d[1] = digs[(x) & 0xf]; \ d[1] = digs[(x) & 0xf]; \
d[0] = digs[((x)>>4)&0xf]; ch += (x & 0xff); d[0] = digs[((x)>>4)&0xf]; \
#define ISHEX(x) (hex_value[x] != NOT_HEX) ch += ((x) & 0xff);
#define ISHEX(x) (hex_value[(unsigned char)(x)] != NOT_HEX)
@ -104,7 +104,7 @@ DEFUN_VOID(srec_init)
inited = true; inited = true;
for (i = 0; i < CHARS_IN_SET; i++) for (i = 0; i < sizeof (hex_value); i++)
{ {
hex_value[i] = NOT_HEX; hex_value[i] = NOT_HEX;
} }
@ -429,7 +429,6 @@ void DEFUN(srec_write_record,(abfd, type, address, data, end),
{ {
TOHEX(dst, *src, check_sum); TOHEX(dst, *src, check_sum);
dst+=2; dst+=2;
} }
/* Fill in the length */ /* Fill in the length */