This lot mainly cleans up `comparison between signed and unsigned' gcc

warnings.  One usused var, and a macro parenthesis fix too.  Also check
input sections are elf when doing gc in elflink.h.
This commit is contained in:
Alan Modra 2000-02-21 12:01:27 +00:00
parent 2403ff6fdb
commit f6af82bd44
18 changed files with 159 additions and 85 deletions

View file

@ -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> 2000-02-21 Ian Lance Taylor <ian@zembu.com>
ELF HPPA doesn't work at present; remove it until it does. ELF HPPA doesn't work at present; remove it until it does.

View file

@ -934,7 +934,7 @@ FUNCTION
bfd_octets_per_byte bfd_octets_per_byte
SYNOPSIS SYNOPSIS
int bfd_octets_per_byte(bfd *abfd); unsigned int bfd_octets_per_byte(bfd *abfd);
DESCRIPTION DESCRIPTION
Return the number of octets (8-bit quantities) per target byte 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_octets_per_byte (abfd)
bfd * abfd; bfd * abfd;
{ {
@ -956,8 +956,8 @@ FUNCTION
bfd_arch_mach_octets_per_byte bfd_arch_mach_octets_per_byte
SYNOPSIS SYNOPSIS
int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch, unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch,
unsigned long machine); unsigned long machine);
DESCRIPTION DESCRIPTION
See bfd_octets_per_byte. See bfd_octets_per_byte.
@ -966,7 +966,7 @@ DESCRIPTION
available available
*/ */
int unsigned int
bfd_arch_mach_octets_per_byte (arch, mach) bfd_arch_mach_octets_per_byte (arch, mach)
enum bfd_architecture arch; enum bfd_architecture arch;
unsigned long mach; unsigned long mach;
@ -977,4 +977,3 @@ bfd_arch_mach_octets_per_byte (arch, mach)
return ap->bits_per_byte / 8; return ap->bits_per_byte / 8;
return 1; return 1;
} }

View file

@ -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_und_symbol;
extern const struct symbol_cache_entry * const bfd_ind_symbol; extern const struct symbol_cache_entry * const bfd_ind_symbol;
#define bfd_get_section_size_before_reloc(section) \ #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) \ #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 * asection *
bfd_get_section_by_name PARAMS ((bfd *abfd, CONST char *name)); bfd_get_section_by_name PARAMS ((bfd *abfd, CONST char *name));
@ -1467,10 +1469,10 @@ const char *
bfd_printable_arch_mach bfd_printable_arch_mach
PARAMS ((enum bfd_architecture arch, unsigned long machine)); PARAMS ((enum bfd_architecture arch, unsigned long machine));
int unsigned int
bfd_octets_per_byte PARAMS ((bfd *abfd)); bfd_octets_per_byte PARAMS ((bfd *abfd));
int unsigned int
bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch, bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch,
unsigned long machine)); unsigned long machine));

View file

@ -6202,6 +6202,9 @@ elf_gc_sweep (info, gc_sweep_hook)
{ {
asection *o; asection *o;
if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
continue;
for (o = sub->sections; o != NULL; o = o->next) for (o = sub->sections; o != NULL; o = o->next)
{ {
/* Keep special sections. Keep .debug sections. */ /* 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) for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
{ {
asection *o; asection *o;
if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
continue;
for (o = sub->sections; o != NULL; o = o->next) for (o = sub->sections; o != NULL; o = o->next)
{ {
if (o->flags & SEC_KEEP) if (o->flags & SEC_KEEP)
@ -6571,10 +6578,14 @@ elf_gc_common_finalize_got_offsets (abfd, info)
/* Do the local .got entries first. */ /* Do the local .got entries first. */
for (i = info->input_bfds; i; i = i->link_next) 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; bfd_size_type j, locsymcount;
Elf_Internal_Shdr *symtab_hdr; 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) if (!local_got)
continue; continue;

View file

@ -274,7 +274,7 @@ bfd_read (ptr, size, nitems, abfd)
get = size * nitems; get = size * nitems;
if (abfd->where + get > bim->size) if (abfd->where + get > bim->size)
{ {
if (bim->size < abfd->where) if (bim->size < (bfd_size_type) abfd->where)
get = 0; get = 0;
else else
get = bim->size - abfd->where; get = bim->size - abfd->where;
@ -689,7 +689,7 @@ bfd_seek (abfd, position, direction)
else else
abfd->where += position; abfd->where += position;
if (abfd->where > bim->size) if ((bfd_size_type) abfd->where > bim->size)
{ {
abfd->where = bim->size; abfd->where = bim->size;
bfd_set_error (bfd_error_file_truncated); bfd_set_error (bfd_error_file_truncated);

View file

@ -508,9 +508,11 @@ CODE_FRAGMENT
.extern const struct symbol_cache_entry * const bfd_und_symbol; .extern const struct symbol_cache_entry * const bfd_und_symbol;
.extern const struct symbol_cache_entry * const bfd_ind_symbol; .extern const struct symbol_cache_entry * const bfd_ind_symbol;
.#define bfd_get_section_size_before_reloc(section) \ .#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) \ .#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 /* We use a macro to initialize the static asymbol structures because

View file

@ -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 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, 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. */ 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_datasec (abfd)->filepos = NBPG * UPAGES;
core_stacksec (abfd)->filepos = (NBPG * UPAGES) + NBPG * u.u_dsize core_stacksec (abfd)->filepos = (NBPG * UPAGES) + NBPG * u.u_dsize

View file

@ -1,3 +1,11 @@
2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au>
* objdump.c (dump_section_header): Change `opb' to unsigned.
(find_symbol_for_address): Same here.
(disassemble_data): And here. Change `addr_offset',
`stop_offset', `nextstop_offset' to unsigned long.
(dump_data): Change opb to unsigned.
2000-02-18 Frank Ch. Eigler <fche@redhat.com> 2000-02-18 Frank Ch. Eigler <fche@redhat.com>
* resrc.c: Remove unmatched #if for cygwin. * resrc.c: Remove unmatched #if for cygwin.

View file

@ -340,7 +340,7 @@ dump_section_header (abfd, section, ignored)
PTR ignored ATTRIBUTE_UNUSED; PTR ignored ATTRIBUTE_UNUSED;
{ {
char *comma = ""; char *comma = "";
int opb = bfd_octets_per_byte (abfd); unsigned int opb = bfd_octets_per_byte (abfd);
printf ("%3d %-13s %08lx ", section->index, printf ("%3d %-13s %08lx ", section->index,
bfd_get_section_name (abfd, section), bfd_get_section_name (abfd, section),
@ -743,7 +743,7 @@ find_symbol_for_address (abfd, sec, vma, require_sec, place)
long min = 0; long min = 0;
long max = sorted_symcount; long max = sorted_symcount;
long thisplace; long thisplace;
int opb = bfd_octets_per_byte (abfd); unsigned int opb = bfd_octets_per_byte (abfd);
if (sorted_symcount < 1) if (sorted_symcount < 1)
return NULL; return NULL;
@ -1574,12 +1574,12 @@ static void
disassemble_data (abfd) disassemble_data (abfd)
bfd *abfd; bfd *abfd;
{ {
long addr_offset; unsigned long addr_offset;
disassembler_ftype disassemble_fn; disassembler_ftype disassemble_fn;
struct disassemble_info disasm_info; struct disassemble_info disasm_info;
struct objdump_disasm_info aux; struct objdump_disasm_info aux;
asection *section; asection *section;
int opb = bfd_octets_per_byte (abfd); unsigned int opb = bfd_octets_per_byte (abfd);
print_files = NULL; print_files = NULL;
prev_functionname = NULL; prev_functionname = NULL;
@ -1659,7 +1659,7 @@ disassemble_data (abfd)
arelent **relbuf = NULL; arelent **relbuf = NULL;
arelent **relpp = NULL; arelent **relpp = NULL;
arelent **relppend = NULL; arelent **relppend = NULL;
long stop_offset; unsigned long stop_offset;
asymbol *sym = NULL; asymbol *sym = NULL;
long place = 0; long place = 0;
@ -1743,7 +1743,7 @@ disassemble_data (abfd)
while (addr_offset < stop_offset) while (addr_offset < stop_offset)
{ {
asymbol *nextsym; asymbol *nextsym;
long nextstop_offset; unsigned long nextstop_offset;
boolean insns; boolean insns;
if (sym != NULL && bfd_asymbol_value (sym) <= section->vma + addr_offset) if (sym != NULL && bfd_asymbol_value (sym) <= section->vma + addr_offset)
@ -2264,7 +2264,7 @@ dump_data (abfd)
bfd_size_type datasize = 0; bfd_size_type datasize = 0;
bfd_size_type addr_offset; bfd_size_type addr_offset;
bfd_size_type start_offset, stop_offset; bfd_size_type start_offset, stop_offset;
int opb = bfd_octets_per_byte (abfd); unsigned int opb = bfd_octets_per_byte (abfd);
for (section = abfd->sections; section != NULL; section = for (section = abfd->sections; section != NULL; section =
section->next) section->next)

View file

@ -1,3 +1,14 @@
2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au>
* listing.c (print_lines): Remove unused variable `end'.
* config/tc-i386.c (md_assemble): Use `reloc()' to select reloc
type for JumpInterSegment output. Use enum bfd_reloc_code_real for
reloc_type when BFD_ASSEMBLER.
(md_estimate_size_before_relax): Use enum bfd_reloc_code_real for
reloc_type when BFD_ASSEMBLER. Move common code out of switch
statement and quell signed vs. unsigned comparison warning.
2000-02-18 Nick Clifton <nickc@cygnus.com> 2000-02-18 Nick Clifton <nickc@cygnus.com>
* config/tc-d10v.c (find_opcode): Add a symbol's value to * config/tc-d10v.c (find_opcode): Add a symbol's value to

View file

@ -892,7 +892,7 @@ tc_i386_force_relocation (fixp)
return 0; return 0;
#else #else
/* For COFF */ /* For COFF */
return fixp->fx_r_type==7; return fixp->fx_r_type == 7;
#endif #endif
} }
@ -2204,7 +2204,6 @@ md_assemble (line)
else if (i.tm.opcode_modifier & JumpInterSegment) else if (i.tm.opcode_modifier & JumpInterSegment)
{ {
int size; int size;
int reloc_type;
int prefix; int prefix;
int code16; int code16;
@ -2221,12 +2220,8 @@ md_assemble (line)
} }
size = 4; size = 4;
reloc_type = BFD_RELOC_32;
if (code16) if (code16)
{ size = 2;
size = 2;
reloc_type = BFD_RELOC_16;
}
if (i.prefixes != 0 && !intel_syntax) if (i.prefixes != 0 && !intel_syntax)
as_warn (_("skipping prefixes on this instruction")); as_warn (_("skipping prefixes on this instruction"));
@ -2249,7 +2244,7 @@ md_assemble (line)
} }
else else
fix_new_exp (frag_now, p - frag_now->fr_literal, size, fix_new_exp (frag_now, p - frag_now->fr_literal, size,
i.imms[1], 0, reloc_type); i.imms[1], 0, reloc (size, 0, i.disp_reloc[0]));
if (i.imms[0]->X_op != O_constant) if (i.imms[0]->X_op != O_constant)
as_bad (_("can't handle non absolute segment in `%s'"), as_bad (_("can't handle non absolute segment in `%s'"),
i.tm.name); i.tm.name);
@ -2424,7 +2419,11 @@ md_assemble (line)
/* Need a 32-bit fixup (don't support 8bit /* Need a 32-bit fixup (don't support 8bit
non-absolute ims). Try to support other non-absolute ims). Try to support other
sizes ... */ sizes ... */
int r_type; #ifdef BFD_ASSEMBLER
enum bfd_reloc_code_real reloc_type;
#else
int reloc_type;
#endif
int size; int size;
int pcrel = 0; int pcrel = 0;
@ -2436,9 +2435,9 @@ md_assemble (line)
size = 4; size = 4;
insn_size += size; insn_size += size;
p = frag_more (size); p = frag_more (size);
r_type = reloc (size, 0, i.disp_reloc[0]); reloc_type = reloc (size, 0, i.disp_reloc[0]);
#ifdef BFD_ASSEMBLER #ifdef BFD_ASSEMBLER
if (r_type == BFD_RELOC_32 if (reloc_type == BFD_RELOC_32
&& GOT_symbol && GOT_symbol
&& GOT_symbol == i.imms[n]->X_add_symbol && GOT_symbol == i.imms[n]->X_add_symbol
&& (i.imms[n]->X_op == O_symbol && (i.imms[n]->X_op == O_symbol
@ -2447,12 +2446,12 @@ md_assemble (line)
(i.imms[n]->X_op_symbol)->X_op) (i.imms[n]->X_op_symbol)->X_op)
== O_subtract)))) == O_subtract))))
{ {
r_type = BFD_RELOC_386_GOTPC; reloc_type = BFD_RELOC_386_GOTPC;
i.imms[n]->X_add_number += 3; i.imms[n]->X_add_number += 3;
} }
#endif #endif
fix_new_exp (frag_now, p - frag_now->fr_literal, size, fix_new_exp (frag_now, p - frag_now->fr_literal, size,
i.imms[n], pcrel, r_type); i.imms[n], pcrel, reloc_type);
} }
} }
} }
@ -3643,7 +3642,24 @@ md_estimate_size_before_relax (fragP, segment)
/* symbol is undefined in this segment */ /* symbol is undefined in this segment */
int code16 = fragP->fr_subtype & CODE16; int code16 = fragP->fr_subtype & CODE16;
int size = code16 ? 2 : 4; int size = code16 ? 2 : 4;
int pcrel_reloc = code16 ? BFD_RELOC_16_PCREL : BFD_RELOC_32_PCREL; #ifdef BFD_ASSEMBLER
enum bfd_reloc_code_real reloc_type;
#else
int reloc_type;
#endif
if (GOT_symbol /* Not quite right - we should switch on presence of
@PLT, but I cannot see how to get to that from
here. We should have done this in md_assemble to
really get it right all of the time, but I think it
does not matter that much, as this will be right
most of the time. ERY */
&& S_GET_SEGMENT(fragP->fr_symbol) == undefined_section)
reloc_type = BFD_RELOC_386_PLT32;
else if (code16)
reloc_type = BFD_RELOC_16_PCREL;
else
reloc_type = BFD_RELOC_32_PCREL;
switch (opcode[0]) switch (opcode[0])
{ {
@ -3653,31 +3669,19 @@ md_estimate_size_before_relax (fragP, segment)
fix_new (fragP, old_fr_fix, size, fix_new (fragP, old_fr_fix, size,
fragP->fr_symbol, fragP->fr_symbol,
fragP->fr_offset, 1, fragP->fr_offset, 1,
(GOT_symbol && /* Not quite right - we should switch on reloc_type);
presence of @PLT, but I cannot see how
to get to that from here. We should have
done this in md_assemble to really
get it right all of the time, but I
think it does not matter that much, as
this will be right most of the time. ERY*/
S_GET_SEGMENT(fragP->fr_symbol) == undefined_section)
? BFD_RELOC_386_PLT32 : pcrel_reloc);
break; break;
default: default:
/* This changes the byte-displacement jump 0x7N /* This changes the byte-displacement jump 0x7N
to the dword-displacement jump 0x0f8N. */ to the dword-displacement jump 0x0f,0x8N. */
opcode[1] = opcode[0] + 0x10; opcode[1] = opcode[0] + 0x10;
opcode[0] = TWO_BYTE_OPCODE_ESCAPE; /* two-byte escape */ opcode[0] = TWO_BYTE_OPCODE_ESCAPE;
fragP->fr_fix += 1 + size; /* we've added an opcode byte */ fragP->fr_fix += 1 + size; /* we've added an opcode byte */
fix_new (fragP, old_fr_fix + 1, size, fix_new (fragP, old_fr_fix + 1, size,
fragP->fr_symbol, fragP->fr_symbol,
fragP->fr_offset, 1, fragP->fr_offset, 1,
(GOT_symbol && /* Not quite right - we should switch on reloc_type);
presence of @PLT, but I cannot see how
to get to that from here. ERY */
S_GET_SEGMENT(fragP->fr_symbol) == undefined_section)
? BFD_RELOC_386_PLT32 : pcrel_reloc);
break; break;
} }
frag_wane (fragP); frag_wane (fragP);

View file

@ -679,7 +679,6 @@ print_lines (list, lineno, string, address)
unsigned int lines; unsigned int lines;
unsigned int octet_in_word = 0; unsigned int octet_in_word = 0;
char *src = data_buffer; char *src = data_buffer;
int end = strlen(src);
int cur; int cur;
/* Print the stuff on the first line */ /* Print the stuff on the first line */

View file

@ -1,3 +1,10 @@
2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au>
* dis-asm.h (struct disassemble_info): Change `length' param of
read_memory_func to unsigned. Change type of `buffer_length' and
`octets_per_byte' to unsigned.
(buffer_read_memory): Change `length' param to unsigned.
2000-02-16 Nick Clifton <nickc@cygnus.com> 2000-02-16 Nick Clifton <nickc@cygnus.com>
* dis-asm.h: Add prototypes for ARM register name functions. * dis-asm.h: Add prototypes for ARM register name functions.

View file

@ -78,7 +78,7 @@ typedef struct disassemble_info {
INFO is a pointer to this struct. INFO is a pointer to this struct.
Returns an errno value or 0 for success. */ Returns an errno value or 0 for success. */
int (*read_memory_func) int (*read_memory_func)
PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int length, PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,
struct disassemble_info *info)); struct disassemble_info *info));
/* Function which should be called if we get an error that we can't /* Function which should be called if we get an error that we can't
@ -105,7 +105,7 @@ typedef struct disassemble_info {
/* These are for buffer_read_memory. */ /* These are for buffer_read_memory. */
bfd_byte *buffer; bfd_byte *buffer;
bfd_vma buffer_vma; bfd_vma buffer_vma;
int buffer_length; unsigned int buffer_length;
/* This variable may be set by the instruction decoder. It suggests /* This variable may be set by the instruction decoder. It suggests
the number of bytes objdump should display on a single line. If the number of bytes objdump should display on a single line. If
@ -124,7 +124,7 @@ typedef struct disassemble_info {
/* Number of octets per incremented target address /* Number of octets per incremented target address
Normally one, but some DSPs have byte sizes of 16 or 32 bits Normally one, but some DSPs have byte sizes of 16 or 32 bits
*/ */
int octets_per_byte; unsigned int octets_per_byte;
/* Results from instruction decoders. Not all decoders yet support /* Results from instruction decoders. Not all decoders yet support
this information. This info is set each time an instruction is this information. This info is set each time an instruction is
@ -213,7 +213,7 @@ extern void disassembler_usage PARAMS ((FILE *));
/* Here is a function which callers may wish to use for read_memory_func. /* Here is a function which callers may wish to use for read_memory_func.
It gets bytes from a buffer. */ It gets bytes from a buffer. */
extern int buffer_read_memory extern int buffer_read_memory
PARAMS ((bfd_vma, bfd_byte *, int, struct disassemble_info *)); PARAMS ((bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *));
/* This function goes with buffer_read_memory. /* This function goes with buffer_read_memory.
It prints a message using info->fprintf_func and info->stream. */ It prints a message using info->fprintf_func and info->stream. */

View file

@ -1,3 +1,12 @@
2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au>
* ldlang.c (print_input_section, print_data_statement,
print_reloc_statement, print_padding_statement, insert_pad,
size_input_section, lang_check_section_addresses,
lang_size_sections, lang_do_assignments, lang_set_startof,
lang_one_common): Change `opb' to unsigned.
(lang_do_assignments): Also change `size' to unsigned.
2000-02-16 Richard Henderson <rth@cygnus.com> 2000-02-16 Richard Henderson <rth@cygnus.com>
* scripttempl/elf.sc: Place OTHER_PLT_RELOC_SECTION. * scripttempl/elf.sc: Place OTHER_PLT_RELOC_SECTION.

View file

@ -2169,8 +2169,8 @@ print_input_section (in)
{ {
asection *i = in->section; asection *i = in->section;
bfd_size_type size = i->_cooked_size != 0 ? i->_cooked_size : i->_raw_size; bfd_size_type size = i->_cooked_size != 0 ? i->_cooked_size : i->_raw_size;
int opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
if (size != 0) if (size != 0)
{ {
print_space (); print_space ();
@ -2236,8 +2236,8 @@ print_data_statement (data)
bfd_vma addr; bfd_vma addr;
bfd_size_type size; bfd_size_type size;
const char *name; const char *name;
int opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
print_space (); print_space ();
@ -2307,8 +2307,8 @@ print_reloc_statement (reloc)
int i; int i;
bfd_vma addr; bfd_vma addr;
bfd_size_type size; bfd_size_type size;
int opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
print_space (); print_space ();
@ -2339,8 +2339,8 @@ print_padding_statement (s)
{ {
int len; int len;
bfd_vma addr; bfd_vma addr;
int opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
minfo (" *fill*"); minfo (" *fill*");
@ -2556,8 +2556,8 @@ insert_pad (this_ptr, fill, power, output_section_statement, dot)
inserting a magic 'padding' statement. inserting a magic 'padding' statement.
*/ */
int opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
unsigned int alignment_needed = align_power (dot, power) - dot; unsigned int alignment_needed = align_power (dot, power) - dot;
if (alignment_needed != 0) if (alignment_needed != 0)
@ -2599,8 +2599,8 @@ size_input_section (this_ptr, output_section_statement, fill, dot, relax)
{ {
lang_input_section_type *is = &((*this_ptr)->input_section); lang_input_section_type *is = &((*this_ptr)->input_section);
asection *i = is->section; asection *i = is->section;
int opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
if (is->ifile->just_syms_flag == false) if (is->ifile->just_syms_flag == false)
{ {
@ -2643,7 +2643,7 @@ static void
lang_check_section_addresses () lang_check_section_addresses ()
{ {
asection * s; asection * s;
int opb = bfd_octets_per_byte (output_bfd); unsigned opb = bfd_octets_per_byte (output_bfd);
/* Scan all sections in the output list. */ /* Scan all sections in the output list. */
for (s = output_bfd->sections; s != NULL; s = s->next) for (s = output_bfd->sections; s != NULL; s = s->next)
@ -2744,8 +2744,8 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
bfd_vma dot; bfd_vma dot;
boolean relax; boolean relax;
{ {
int opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
/* Size up the sections from their constituent parts. */ /* Size up the sections from their constituent parts. */
for (; s != (lang_statement_union_type *) NULL; s = s->next) for (; s != (lang_statement_union_type *) NULL; s = s->next)
@ -3119,8 +3119,8 @@ lang_do_assignments (s, output_section_statement, fill, dot)
fill_type fill; fill_type fill;
bfd_vma dot; bfd_vma dot;
{ {
int opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
for (; s != (lang_statement_union_type *) NULL; s = s->next) for (; s != (lang_statement_union_type *) NULL; s = s->next)
{ {
@ -3185,7 +3185,7 @@ lang_do_assignments (s, output_section_statement, fill, dot)
einfo (_("%F%P: invalid data statement\n")); einfo (_("%F%P: invalid data statement\n"));
} }
{ {
int size; unsigned int size;
switch (s->data_statement.type) switch (s->data_statement.type)
{ {
default: default:
@ -3309,8 +3309,8 @@ lang_set_startof ()
h = bfd_link_hash_lookup (link_info.hash, buf, false, false, true); h = bfd_link_hash_lookup (link_info.hash, buf, false, false, true);
if (h != NULL && h->type == bfd_link_hash_undefined) if (h != NULL && h->type == bfd_link_hash_undefined)
{ {
int opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
h->type = bfd_link_hash_defined; h->type = bfd_link_hash_defined;
if (s->_cooked_size != 0) if (s->_cooked_size != 0)
h->u.def.value = s->_cooked_size / opb; h->u.def.value = s->_cooked_size / opb;
@ -3492,8 +3492,8 @@ lang_one_common (h, info)
unsigned int power_of_two; unsigned int power_of_two;
bfd_vma size; bfd_vma size;
asection *section; asection *section;
int opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine); ldfile_output_machine);
if (h->type != bfd_link_hash_common) if (h->type != bfd_link_hash_common)
return true; return true;

View file

@ -1,3 +1,8 @@
2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au>
* dis-buf.c (buffer_read_memory): Change `length' param and all int
vars to unsigned.
Thu Feb 17 00:18:12 2000 J"orn Rennecke <amylaar@cygnus.co.uk> Thu Feb 17 00:18:12 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
* sh-dis.c (print_movxy, print_insn_ddt, print_dsp_reg): New functions. * sh-dis.c (print_movxy, print_insn_ddt, print_dsp_reg): New functions.

View file

@ -26,13 +26,13 @@ int
buffer_read_memory (memaddr, myaddr, length, info) buffer_read_memory (memaddr, myaddr, length, info)
bfd_vma memaddr; bfd_vma memaddr;
bfd_byte *myaddr; bfd_byte *myaddr;
int length; unsigned int length;
struct disassemble_info *info; struct disassemble_info *info;
{ {
int opb = info->octets_per_byte; unsigned int opb = info->octets_per_byte;
int end_addr_offset = length / opb; unsigned int end_addr_offset = length / opb;
int max_addr_offset = info->buffer_length / opb; unsigned int max_addr_offset = info->buffer_length / opb;
int octets = (memaddr - info->buffer_vma) * opb; unsigned int octets = (memaddr - info->buffer_vma) * opb;
if (memaddr < info->buffer_vma if (memaddr < info->buffer_vma
|| memaddr - info->buffer_vma + end_addr_offset > max_addr_offset) || memaddr - info->buffer_vma + end_addr_offset > max_addr_offset)