* elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code

reloading local sym addend mistakenly removed in 2002-05-01 change.

	* dwarf2.c (struct line_head): Make prologue_length a bfd_vma.
	(read_abbrevs): Change "offset" param to bfd_vma.
	(parse_comp_unit): Change "version" and addr_size to unsigned ints.
	Change "abbrev_offset" to bfd_vma.
	(read_indirect_string): Use correct conversion chars in error
	message format string, cast bfd_vma's to unsigned long.
	(read_abbrevs): Likewise.
	(read_attribute_value): Likewise.
	(decode_line_info): Likewise.
	(scan_unit_for_functions): Likewise.
	(parse_comp_unit): Likewise.
This commit is contained in:
Alan Modra 2002-05-04 12:01:02 +00:00
parent 59862849e4
commit f46c2da63e
3 changed files with 36 additions and 17 deletions

View file

@ -1,3 +1,20 @@
2002-05-04 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code
reloading local sym addend mistakenly removed in 2002-05-01 change.
* dwarf2.c (struct line_head): Make prologue_length a bfd_vma.
(read_abbrevs): Change "offset" param to bfd_vma.
(parse_comp_unit): Change "version" and addr_size to unsigned ints.
Change "abbrev_offset" to bfd_vma.
(read_indirect_string): Use correct conversion chars in error
message format string, cast bfd_vma's to unsigned long.
(read_abbrevs): Likewise.
(read_attribute_value): Likewise.
(decode_line_info): Likewise.
(scan_unit_for_functions): Likewise.
(parse_comp_unit): Likewise.
2002-05-04 Tom Rix <trix@redhat.com> 2002-05-04 Tom Rix <trix@redhat.com>
* coffswap.h (coff_swap_reloc_in): Remove XCOFF support. * coffswap.h (coff_swap_reloc_in): Remove XCOFF support.

View file

@ -42,7 +42,7 @@ struct line_head
{ {
bfd_vma total_length; bfd_vma total_length;
unsigned short version; unsigned short version;
unsigned int prologue_length; bfd_vma prologue_length;
unsigned char minimum_instruction_length; unsigned char minimum_instruction_length;
unsigned char default_is_stmt; unsigned char default_is_stmt;
int line_base; int line_base;
@ -225,7 +225,7 @@ static bfd_vma read_address PARAMS ((struct comp_unit *, char *));
static struct abbrev_info *lookup_abbrev static struct abbrev_info *lookup_abbrev
PARAMS ((unsigned int, struct abbrev_info **)); PARAMS ((unsigned int, struct abbrev_info **));
static struct abbrev_info **read_abbrevs static struct abbrev_info **read_abbrevs
PARAMS ((bfd *, unsigned int, struct dwarf2_debug *)); PARAMS ((bfd *, bfd_vma, struct dwarf2_debug *));
static char *read_attribute static char *read_attribute
PARAMS ((struct attribute *, struct attr_abbrev *, PARAMS ((struct attribute *, struct attr_abbrev *,
struct comp_unit *, char *)); struct comp_unit *, char *));
@ -396,8 +396,8 @@ read_indirect_string (unit, buf, bytes_read_ptr)
if (offset >= stash->dwarf_str_size) if (offset >= stash->dwarf_str_size)
{ {
(*_bfd_error_handler) (_("Dwarf Error: DW_FORM_strp offset (%u) greater than or equal to .debug_str size (%u)."), (*_bfd_error_handler) (_("Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str size (%lu)."),
offset, stash->dwarf_str_size); (unsigned long) offset, stash->dwarf_str_size);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return NULL; return NULL;
} }
@ -523,7 +523,7 @@ lookup_abbrev (number,abbrevs)
static struct abbrev_info** static struct abbrev_info**
read_abbrevs (abfd, offset, stash) read_abbrevs (abfd, offset, stash)
bfd * abfd; bfd * abfd;
unsigned int offset; bfd_vma offset;
struct dwarf2_debug *stash; struct dwarf2_debug *stash;
{ {
struct abbrev_info **abbrevs; struct abbrev_info **abbrevs;
@ -557,8 +557,8 @@ read_abbrevs (abfd, offset, stash)
if (offset >= stash->dwarf_abbrev_size) if (offset >= stash->dwarf_abbrev_size)
{ {
(*_bfd_error_handler) (_("Dwarf Error: Abbrev offset (%u) greater than or equal to .debug_abbrev size (%u)."), (*_bfd_error_handler) (_("Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)."),
offset, stash->dwarf_abbrev_size); (unsigned long) offset, stash->dwarf_abbrev_size);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return 0; return 0;
} }
@ -754,7 +754,7 @@ read_attribute_value (attr, form, unit, info_ptr)
info_ptr = read_attribute_value (attr, form, unit, info_ptr); info_ptr = read_attribute_value (attr, form, unit, info_ptr);
break; break;
default: default:
(*_bfd_error_handler) (_("Dwarf Error: Invalid or unhandled FORM value: %d."), (*_bfd_error_handler) (_("Dwarf Error: Invalid or unhandled FORM value: %u."),
form); form);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
} }
@ -958,7 +958,7 @@ decode_line_info (unit, stash)
below. */ below. */
if (unit->line_offset >= stash->dwarf_line_size) if (unit->line_offset >= stash->dwarf_line_size)
{ {
(*_bfd_error_handler) (_("Dwarf Error: Line offset (%u) greater than or equal to .debug_line size (%u)."), (*_bfd_error_handler) (_("Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%lu)."),
unit->line_offset, stash->dwarf_line_size); unit->line_offset, stash->dwarf_line_size);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return 0; return 0;
@ -1345,7 +1345,7 @@ scan_unit_for_functions (unit)
abbrev = lookup_abbrev (abbrev_number,unit->abbrevs); abbrev = lookup_abbrev (abbrev_number,unit->abbrevs);
if (! abbrev) if (! abbrev)
{ {
(*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %d."), (*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %u."),
abbrev_number); abbrev_number);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return false;
@ -1486,9 +1486,9 @@ parse_comp_unit (abfd, stash, unit_length, offset_size)
unsigned int offset_size; unsigned int offset_size;
{ {
struct comp_unit* unit; struct comp_unit* unit;
unsigned short version; unsigned int version;
unsigned int abbrev_offset = 0; bfd_vma abbrev_offset = 0;
unsigned char addr_size; unsigned int addr_size;
struct abbrev_info** abbrevs; struct abbrev_info** abbrevs;
unsigned int abbrev_number, bytes_read, i; unsigned int abbrev_number, bytes_read, i;
struct abbrev_info *abbrev; struct abbrev_info *abbrev;
@ -1517,7 +1517,7 @@ parse_comp_unit (abfd, stash, unit_length, offset_size)
if (version != 2) if (version != 2)
{ {
(*_bfd_error_handler) (_("Dwarf Error: found dwarf version '%hu', this reader only handles version 2 information."), version); (*_bfd_error_handler) (_("Dwarf Error: found dwarf version '%u', this reader only handles version 2 information."), version);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return 0; return 0;
} }
@ -1526,7 +1526,7 @@ parse_comp_unit (abfd, stash, unit_length, offset_size)
{ {
(*_bfd_error_handler) (_("Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'."), (*_bfd_error_handler) (_("Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'."),
addr_size, addr_size,
sizeof (bfd_vma)); (unsigned int) sizeof (bfd_vma));
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return 0; return 0;
} }
@ -1547,7 +1547,7 @@ parse_comp_unit (abfd, stash, unit_length, offset_size)
info_ptr += bytes_read; info_ptr += bytes_read;
if (! abbrev_number) if (! abbrev_number)
{ {
(*_bfd_error_handler) (_("Dwarf Error: Bad abbrev number: %d."), (*_bfd_error_handler) (_("Dwarf Error: Bad abbrev number: %u."),
abbrev_number); abbrev_number);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return 0; return 0;
@ -1556,7 +1556,7 @@ parse_comp_unit (abfd, stash, unit_length, offset_size)
abbrev = lookup_abbrev (abbrev_number, abbrevs); abbrev = lookup_abbrev (abbrev_number, abbrevs);
if (! abbrev) if (! abbrev)
{ {
(*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %d."), (*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %u."),
abbrev_number); abbrev_number);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return 0; return 0;

View file

@ -5128,6 +5128,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
sym_name = "<local symbol>"; sym_name = "<local symbol>";
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
/* rel may have changed, update our copy of addend. */
addend = rel->r_addend;
} }
else else
{ {