diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 17 | ||||
-rw-r--r-- | bfd/archures.c | 11 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 10 | ||||
-rw-r--r-- | bfd/elflink.h | 13 | ||||
-rw-r--r-- | bfd/libbfd.c | 4 | ||||
-rw-r--r-- | bfd/section.c | 6 | ||||
-rw-r--r-- | bfd/trad-core.c | 2 |
7 files changed, 47 insertions, 16 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ecb6642..d5bf4dd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,20 @@ +2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au> + + * archures.c (bfd_octets_per_byte): Return unsigned int. + (bfd_arch_mach_octets_per_byte): Ditto. + * libbfd.c (bfd_read, bfd_seek): Quell signed vs. unsigned + comparison warning. + * section.c (bfd_get_section_size_before_reloc): Quell signed + vs. unsigned comparison warning. + (bfd_get_section_size_after_reloc): Same here. Fix parentheses too. + * trad-core.c (trad_unix_core_file_p): Correct 2000-01-27 + change. What was I thinking? + * bfd-in2.h: Regenerate. + + * elflink.h (elf_gc_sweep): Skip non-elf input bfds. + (elf_gc_sections): Same here. + (elf_gc_common_finalize_got_offsets): And here. + 2000-02-21 Ian Lance Taylor <ian@zembu.com> ELF HPPA doesn't work at present; remove it until it does. diff --git a/bfd/archures.c b/bfd/archures.c index 3c7dc13..21e980e 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -934,7 +934,7 @@ FUNCTION bfd_octets_per_byte SYNOPSIS - int bfd_octets_per_byte(bfd *abfd); + unsigned int bfd_octets_per_byte(bfd *abfd); DESCRIPTION Return the number of octets (8-bit quantities) per target byte @@ -943,7 +943,7 @@ DESCRIPTION */ -int +unsigned int bfd_octets_per_byte (abfd) bfd * abfd; { @@ -956,8 +956,8 @@ FUNCTION bfd_arch_mach_octets_per_byte SYNOPSIS - int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch, - unsigned long machine); + unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch, + unsigned long machine); DESCRIPTION See bfd_octets_per_byte. @@ -966,7 +966,7 @@ DESCRIPTION available */ -int +unsigned int bfd_arch_mach_octets_per_byte (arch, mach) enum bfd_architecture arch; unsigned long mach; @@ -977,4 +977,3 @@ bfd_arch_mach_octets_per_byte (arch, mach) return ap->bits_per_byte / 8; return 1; } - diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index d7b52db..99bc67f 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1219,9 +1219,11 @@ extern const struct symbol_cache_entry * const bfd_com_symbol; extern const struct symbol_cache_entry * const bfd_und_symbol; extern const struct symbol_cache_entry * const bfd_ind_symbol; #define bfd_get_section_size_before_reloc(section) \ - (section->reloc_done ? (abort(),1): (section)->_raw_size) + ((section)->reloc_done ? (abort (), (bfd_size_type) 1) \ + : (section)->_raw_size) #define bfd_get_section_size_after_reloc(section) \ - ((section->reloc_done) ? (section)->_cooked_size: (abort(),1)) + ((section)->reloc_done ? (section)->_cooked_size \ + : (abort (), (bfd_size_type) 1)) asection * bfd_get_section_by_name PARAMS ((bfd *abfd, CONST char *name)); @@ -1467,10 +1469,10 @@ const char * bfd_printable_arch_mach PARAMS ((enum bfd_architecture arch, unsigned long machine)); -int +unsigned int bfd_octets_per_byte PARAMS ((bfd *abfd)); -int +unsigned int bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch, unsigned long machine)); diff --git a/bfd/elflink.h b/bfd/elflink.h index 78a5e34..54577a6 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -6202,6 +6202,9 @@ elf_gc_sweep (info, gc_sweep_hook) { asection *o; + if (bfd_get_flavour (sub) != bfd_target_elf_flavour) + continue; + for (o = sub->sections; o != NULL; o = o->next) { /* Keep special sections. Keep .debug sections. */ @@ -6416,6 +6419,10 @@ elf_gc_sections (abfd, info) for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) { asection *o; + + if (bfd_get_flavour (sub) != bfd_target_elf_flavour) + continue; + for (o = sub->sections; o != NULL; o = o->next) { if (o->flags & SEC_KEEP) @@ -6571,10 +6578,14 @@ elf_gc_common_finalize_got_offsets (abfd, info) /* Do the local .got entries first. */ for (i = info->input_bfds; i; i = i->link_next) { - bfd_signed_vma *local_got = elf_local_got_refcounts (i); + bfd_signed_vma *local_got; bfd_size_type j, locsymcount; Elf_Internal_Shdr *symtab_hdr; + if (bfd_get_flavour (i) != bfd_target_elf_flavour) + continue; + + local_got = elf_local_got_refcounts (i); if (!local_got) continue; diff --git a/bfd/libbfd.c b/bfd/libbfd.c index fb833f6..881af73 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -274,7 +274,7 @@ bfd_read (ptr, size, nitems, abfd) get = size * nitems; if (abfd->where + get > bim->size) { - if (bim->size < abfd->where) + if (bim->size < (bfd_size_type) abfd->where) get = 0; else get = bim->size - abfd->where; @@ -689,7 +689,7 @@ bfd_seek (abfd, position, direction) else abfd->where += position; - if (abfd->where > bim->size) + if ((bfd_size_type) abfd->where > bim->size) { abfd->where = bim->size; bfd_set_error (bfd_error_file_truncated); diff --git a/bfd/section.c b/bfd/section.c index 6e50d16..b3b7608 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -508,9 +508,11 @@ CODE_FRAGMENT .extern const struct symbol_cache_entry * const bfd_und_symbol; .extern const struct symbol_cache_entry * const bfd_ind_symbol; .#define bfd_get_section_size_before_reloc(section) \ -. (section->reloc_done ? (abort(),1): (section)->_raw_size) +. ((section)->reloc_done ? (abort (), (bfd_size_type) 1) \ +. : (section)->_raw_size) .#define bfd_get_section_size_after_reloc(section) \ -. ((section->reloc_done) ? (section)->_cooked_size: (abort(),1)) +. ((section)->reloc_done ? (section)->_cooked_size \ +. : (abort (), (bfd_size_type) 1)) */ /* We use a macro to initialize the static asymbol structures because diff --git a/bfd/trad-core.c b/bfd/trad-core.c index 92c5b63..633c53d 100644 --- a/bfd/trad-core.c +++ b/bfd/trad-core.c @@ -202,7 +202,7 @@ trad_unix_core_file_p (abfd) 0 is at the place pointed to by u_ar0 (by setting the vma of the start of the section to -u_ar0). GDB uses this info to locate the regs, using minor trickery to get around the offset-or-absolute-addr problem. */ - core_regsec (abfd)->vma = (asection *) (0 - (bfd_vma) u.u_ar0); + core_regsec (abfd)->vma = - (bfd_vma) u.u_ar0; core_datasec (abfd)->filepos = NBPG * UPAGES; core_stacksec (abfd)->filepos = (NBPG * UPAGES) + NBPG * u.u_dsize |