coffcode.h, elf.c, libaout.h, libbfd.h, srec.c: Lint.
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.
+ * 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)
* configure.host: New file, contains mapping of host configs
(abfd),
bfd *abfd)
{
- bfd_size_type data_pad = 0;
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
break;
case n_magic:
{
- CONST struct aout_backend_data *abdp;
file_ptr pos = adata(abfd).exec_bytes_size;
bfd_vma vma = 0;
int pad;
{
bfd_vma value;
asymbol *symbol = *(reloc->sym_ptr_ptr);
+
/* 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
live in the output and add that in */
symbol->section->output_offset +
symbol->section->output_section->vma;
}
-
-
+
/* Add the value contained in the relocation */
value += (short)((reloc->addend) & 0xffff);
if (-1<<23 < (long)gap && (long)gap < 1<<23 )
{
-
/* Change the reloc type from 32bitcode possible 24, to 24bit
possible 32 */
/* This will be four bytes smaller in the long run */
shrink += 4 ;
perform_slip(symbols, 4, input_section, r->address-shrink +4);
-
-
}
return shrink;
}
arelent *r AND
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 gap;
bfd_vma old_end;
bfd_vma new_end;
- int shrink_delta;
-int size = r->howto->size;
+ int shrink_delta;
+ int size = r->howto->size;
+
/* 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
than the alignment required. */
-
-
/* calculate the first byte following the padding before we optimize */
old_end = ((dot + size ) & ~size) + size+1;
/* work out where the new end will be - remember that we're smaller
if (shrink_delta)
{
-
/* Change the reloc so that it knows how far to align to */
r->howto = howto_done_align_table + (r->howto - howto_align_table);
r->addend = old_end ;
/* This will be N bytes smaller in the long run, adjust all the symbols */
-
-
-
perform_slip(symbols, shrink_delta, input_section, r->address - shrink );
shrink += shrink_delta;
}
#define BADMAG(x) M68KBADMAG(x)
#define M68 1 /* Customize coffcode.h */
+void
m68k_rtype2howto(internal, relocentry)
-arelent *internal;
-int relocentry;
+ arelent *internal;
+ int relocentry;
{
switch (relocentry)
{
- case R_RELBYTE: (internal)->howto = ( m68kcoff_howto_table + 0);break;
- case R_RELWORD: (internal)->howto = ( m68kcoff_howto_table + 1);break;
- case R_RELLONG: (internal)->howto = ( m68kcoff_howto_table + 2);break;
- case R_PCRBYTE: (internal)->howto = ( m68kcoff_howto_table + 3);break;
- case R_PCRWORD: (internal)->howto = ( m68kcoff_howto_table + 4);break;
- case R_PCRLONG: (internal)->howto = ( m68kcoff_howto_table + 5);break;
- case R_RELLONG_NEG: (internal)->howto = ( m68kcoff_howto_table + 6);break;
+ case R_RELBYTE: internal->howto = m68kcoff_howto_table + 0; break;
+ case R_RELWORD: internal->howto = m68kcoff_howto_table + 1; break;
+ case R_RELLONG: internal->howto = m68kcoff_howto_table + 2; break;
+ case R_PCRBYTE: internal->howto = m68kcoff_howto_table + 3; break;
+ case R_PCRWORD: internal->howto = m68kcoff_howto_table + 4; break;
+ case R_PCRLONG: internal->howto = m68kcoff_howto_table + 5; break;
+ case R_RELLONG_NEG: internal->howto = m68kcoff_howto_table + 6; break;
}
-
-
}
#define RTYPE2HOWTO(internal, relocentry) m68k_rtype2howto(internal, (relocentry)->r_type)
}
static bfd_vma get_value();
-static
+
+static void
extra_case(in_abfd, seclet, reloc, data, src_ptr, dst_ptr)
-bfd *in_abfd;
-bfd_seclet_type *seclet;
-arelent *reloc;
-bfd_byte *data;
-unsigned int *src_ptr;
-unsigned int *dst_ptr;
+ bfd *in_abfd;
+ bfd_seclet_type *seclet;
+ arelent *reloc;
+ bfd_byte *data;
+ unsigned int *src_ptr;
+ unsigned int *dst_ptr;
{
switch (reloc->howto->type)
{
asymbol **sympp2;
unsigned int i;
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++)
{
{
asection *target_sect;
- unsigned int idx;
bfd_section_from_shdr (abfd, hdr->sh_link); /* symbol table */
bfd_section_from_shdr (abfd, hdr->sh_info); /* target */
Elf_Internal_Shdr *i_shdrp; /* Section header table, internal form */
int shindex;
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. */
Elf_Internal_Shdr *hdr = i_shdrp + elf_onesymtab (abfd);
int symcount; /* Number of external ELF symbols */
int i;
- char *strtab; /* Buffer for raw ELF string table section */
asymbol *sym; /* Pointer to current bfd symbol */
asymbol *symbase; /* Buffer for generated bfd symbols */
Elf_Internal_Sym i_sym;
RELOC_PROCESSING(cache_ptr, &dst, symbols, abfd, asect);
#else
Elf_Internal_Rela dst;
- asymbol *ptr;
Elf_External_Rela *src;
cache_ptr = reloc_cache + idx;
/* 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->addend = dst.r_addend;
- /* ptr = *(cache_ptr->sym_ptr_ptr); */
/* Fill in the cache_ptr->howto field from dst.r_type */
elf_info_to_howto(abfd, cache_ptr, &dst);
bfd *abfd AND
asymbol **alocation)
{
- unsigned int symcount;
- asymbol **vec;
if (!elf_slurp_symbol_table (abfd, alocation))
return (0);
#include "sysdep.h"
#include "libbfd.h"
-static char digs[] = "0123456789ABCDEF";
+/* Macros for converting between hex and binary */
-/* Horrible ascii dependent macros for converting between hex and
- binary */
+static const char digs[] = "0123456789ABCDEF";
+
+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 NIBBLE(x) hex_value[x]
+#define NIBBLE(x) hex_value[(unsigned char)(x)]
#define HEX(buffer) ((NIBBLE((buffer)[0])<<4) + NIBBLE((buffer)[1]))
-#define TOHEX(d,x, ch) \
-d[1] = digs[(x) & 0xf]; \
-d[0] = digs[((x)>>4)&0xf]; ch += (x & 0xff);
-#define ISHEX(x) (hex_value[x] != NOT_HEX)
+#define TOHEX(d, x, ch) \
+ d[1] = digs[(x) & 0xf]; \
+ d[0] = digs[((x)>>4)&0xf]; \
+ ch += ((x) & 0xff);
+#define ISHEX(x) (hex_value[(unsigned char)(x)] != NOT_HEX)
inited = true;
- for (i = 0; i < CHARS_IN_SET; i++)
+ for (i = 0; i < sizeof (hex_value); i++)
{
hex_value[i] = NOT_HEX;
}
{
TOHEX(dst, *src, check_sum);
dst+=2;
-
}
/* Fill in the length */