aboutsummaryrefslogtreecommitdiff
path: root/bfd/dwarf2.c
AgeCommit message (Collapse)AuthorFilesLines
2002-10-25 * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index toDave Anglin1-9/+13
unsigned int. Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to unsigned int. (NAME(aout,final_link)): Cast enum used in assignment. (aout_link_write_symbols): Cast enums in comparisons, int values to boolean, enums in assignments to int. (aout_link_input_section_std): Cast rel->r_index to unsigned int. (aout_link_input_section_ext): Likewise. Cast enums used in comparisons with unsigned ints. (aout_link_reloc_link_order): Cast enum to int in assignment. * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr calls to char *. * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in assignment. * bfd-in2.h (bfd_set_section_vma): Likewise. * bfd.c (bfd_record_phdr): Cast enums in assignments. * binary.c (bfd_alloc): Cast enum to long. * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean. * dwarf2.c (read_abbrevs): Add casts to enum types. (read_attribute_value): Likewise. (arange_add): Cast result of bfd_zalloc call. (comp_unit_contains_address): Return true and false. (comp_unit_find_nearest_line): Cast return to boolean. * format.c (bfd_check_format_matches, bfd_set_format): Likewise. * gen-aout.c: define macro '_' if not defined. * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR. (bfd_bwrite): Cast bfd_realloc to bfd_byte *. (bfd_write_bigendian_4byte_int): Cast return to boolean. (bfd_seek): Cast bfd_realloc to bfd_byte *. (bfd_generic_is_local_label_name): Cast return to boolean. * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'. * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to struct bfd_hash_entry *. (_bfd_generic_link_hash_newfunc): likewise. (_bfd_generic_final_link): Cast enum to unsigned int. * merge.c (sec_merge_emit): Cast return to boolean. (merge_strings): Add casts to const unsigned char *. * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int. (bfd_generic_get_relocated_section_content): Cast enum to unsigned int. * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result to struct bfd_hash_entry *. (bfd_set_section_content): Add cast to PTR in comparison. * simple.c (simple_dummy_warning, simple_dummy_undefined_symbol, simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous, simple_dummy_unattached_reloc, bfd_simple_get_relocated_section_contents): Add K&R declarations and function definitions. * srec.c (S3Forced): Initialize to false. (srec_get_symtab): Cast return value from bfd_alloc to asymbol *. * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons. (_bfd_discard_section_stabs): Likewise. Also cast return to boolean. * syms.c (bfd_is_undefined_symclass): Cast return to boolean. (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in comparisons.
2002-10-23 * dwarf2.c (add_line_info): Ensure that the line_info_table isAlan Modra1-20/+108
sorted even when given an out-of-order line sequence. (lookup_address_in_line_info_table): When an exact VMA match is not found, return line information with the closest VMA.
2002-09-24Fix typo introduced with previous delta.Nick Clifton1-2/+1
2002-09-23Update to correctly decode (non-standard DWARF2) out-of-order address sequences.Nick Clifton1-63/+61
2002-09-20(_bfd_dwarf2_find_nearest_line): If address length is zero, set it to 8 forNick Clifton1-0/+7
(non-standard) 64-bit DWARF2 formats (e.g. IRIX64).
2002-07-17From: Ian Rickards <irickard@arm.com>Richard Earnshaw1-2/+7
* dwarf2.c (concat_filename): If we can't establish the directory just return the filename.
2002-06-272002-06-27 Kevin Buettner <kevinb@redhat.com>Alan Modra1-12/+8
* dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit DWARF2 formats.
2002-06-25Check unit->addr_size to read in the proper number of prologue bytes.Nick Clifton1-3/+14
2002-05-04 * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate codeAlan Modra1-17/+17
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-03-202002-03-20 Daniel Jacobowitz <drow@mvista.com>Daniel Jacobowitz1-15/+49
* dwarf2.c (struct funcinfo): Move up. (lookup_address_in_function_table): New argument function_ptr. Set it. (lookup_address_in_line_table): New argument function. If function is non-NULL, use it to handle ``addr'' before the first line note of the function. (comp_unit_find_nearest_line): Update and swap calls to lookup_address_in_function_table and lookup_address_in_line_table. * syms.c (_bfd_stab_section_find_nearest_line): Use the first N_SLINE encountered if we see an N_FUN before any N_SLINE.
2002-01-30Use full section name in error messages.Nick Clifton1-10/+7
2001-11-14 * dwarf2.c (struct line_head) [total_length]: Change type toJakub Jelinek1-22/+108
bfd_vma. (struct dwarf2_debug): Add dwarf_str_buffer and dwarf_str_size. (struct comp_unit): Add stash and offset_size. (read_8_bytes): Return bfd_vma. (read_indirect_string): New. (read_attribute): Handle DW_FORM_strp. (decode_line_info): Support 64-bit DWARF format. (_bfd_dwarf2_find_nearest_line): Likewise. (parse_comp_unit): Set offset_size and stash.
2001-11-13 * dwarf2.c (read_attribute_value): New function to handleRichard Henderson1-8/+28
DW_FORM_indirect. (read_attribute): Use it.
2001-11-13Index: bfd/ChangeLogGeoffrey Keating1-14/+25
2001-11-11 Geoffrey Keating <geoffk@redhat.com> * dwarf2.c (decode_line_info): Properly deal with unknown standard opcodes. Index: binutils/ChangeLog 2001-11-11 Geoffrey Keating <geoffk@redhat.com> * readelf.c (display_debug_lines): Deal with unknown standard opcodes. Handle DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin, DW_LNS_set_isa. Index: include/elf/ChangeLog 2001-11-11 Geoffrey Keating <geoffk@redhat.com> * dwarf2.h (dwarf_line_number_ops): Add DWARF 3 opcodes.
2001-10-06 * dwarf2.c (comp_unit_find_nearest_line): Check for end ofStephane Carrez1-1/+2
compilation unit.
2001-09-18Touches most files in bfd/, so likely will be blamed for everything..Alan Modra1-50/+59
o bfd_read and bfd_write lose an unnecessary param and become bfd_bread and bfd_bwrite. o bfd_*alloc now all take a bfd_size_type arg, and will error if size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files or bugs in linker scripts etc. o file_ptr becomes a bfd_signed_vma. Besides matching sizes with various other types involved in handling sections, this should make it easier for bfd to support a 64 bit off_t on 32 bit hosts that provide it. o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*) generally available. They now cast their args to bfd_vma and bfd_byte * as appropriate, which removes a swag of casts from the source. o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and aout-encap.c. o Zillions of formatting and -Wconversion fixes.
2001-08-09 * coff-rs6000.c: Add missing prototypes.Alan Modra1-24/+66
(xcoff_ppc_relocate_section, xcoff_is_lineno_count_overflow, xcoff_is_reloc_count_overflow, xcoff_loader_symbol_offset, xcoff_loader_reloc_offset): Make static. * dwarf1.c: Add missing prototypes. * dwarf2.c: Add missing prototypes. (struct abbrev_info): Move definition. (struct attr_abbrev, ABBREV_HASH_SIZE, ATTR_ALLOC_CHUNK): Likewise. * elf.c: Add missing prototypes. * elf32-gen.c: Likewise. * elf32-i386.c: Likewise. * elf32-ppc.c: Likewise. (ppc_elf_sort_rela): Use PTR instead of "void *". * elflink.h: Add missing prototypes. Formatting fixes. * merge.c: Add missing prototypes. (last4_eq): Use PTR instead of "void *". (last_eq): Likewise. * syms.c: Add missing prototypes.
2001-08-08* dwarf2.c (struct dwarf2_debug): Add sec, sec_info_ptr and syms.Alexandre Oliva1-2/+82
(find_rela_addend): New function. (parse_comp_unit): Call it to find the abbrev offset addend. (_bfd_dwarf2_find_nearest_line): Initialize and maintain the new members of dwarf2_debug as debugging information is read.
2001-05-21 * dwarf2.c (decode_line_info): Fix error message.Andreas Jaeger1-3/+3
(read_abbrevs): Fix test for offset as suggested by Alan Modra and adjust error message.
2001-03-08Update copyright noticesNick Clifton1-1/+2
2001-01-232001-01-23 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-2/+2
* aoutx.h: Fix formatting. * bfd.c: Likewise. * bfd-in2.h: Likewise. * bfd-in.h: Likewise. * cpu-i386.c: Likewise. * cpu-m68hc11.c: Likewise. * dwarf2.c: Likewise. * elf64-x86-64.c: Likewise. * format.c: Likewise. * freebsd.h: Likewise. * hash.c: Likewise. * hp300hpux.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise.
2000-12-08Generalize DWARF2 and COFF support.Nick Clifton1-25/+30
2000-11-162000-11-16 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-70/+70
* dwarf1.c: Fix formatting. * dwarf2.c: Likewise.
2000-09-02Find all sections containing debug information and include them in the stash.Nick Clifton1-188/+217
2000-04-19K&R compiler fixesAlan Modra1-2/+2
2000-04-07Fix linker segfault that occured when linking ia64-linux kernel.Jim Wilson1-4/+17
* dwarf2.c (struct dwarf2_debug): New field dwarf_line_size. (decode_line_info): Set it. Report error if unit->line_offset is equal to or larger than it.
2000-02-28 * dwarf2.c (read_abbrevs): Use _raw_size directly rather thanIan Lance Taylor1-3/+3
calling bfd_get_section_size_before_reloc. (decode_line_info): Likewise. (_bfd_dwarf2_find_nearest_line): Likewise.
2000-02-23fix typo in previous deltaNick Clifton1-1/+1
2000-02-23Accept 16-bit addresses.Nick Clifton1-11/+13
1999-07-14 * dwarf2.c (read_attribute): Support DW_FORM_ref8.Mark Mitchell1-0/+4
* elf32-mips.c (mips_elf_link_hash_entry): Change mips_32_relocs to possibly_dynamic_relocs. Adjust usage throughout code. (elf_mips_howto_table): Handle R_MIPS_64 correctly. (elf_mips_ctor64_howto): Likewise. (mips_elf_calculate_relocation): Handle R_MIPS_64 like R_MIPS_32. Adjust indentation. (mips_elf_relocate_section): Handle R_MIPS_64 in 32-bit mode. (_bfd_mips_elf_check_relocs): Handle R_MIPS_64 like R_MIPS_32. Use MIPS_ELF_GOT_SIZE to calculate the size of GOT entries. * elf64-mips.c (elf_backend_may_use_rel_p): Define.
1999-07-11 * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSEDIan Lance Taylor1-11/+11
as appropriate. Fill in structure initializations. Add variable initializations. Add casts. * dwarf1.c (parse_line_table): Change eachLine to unsigned long. (dwarf1_unit_find_nearest_line): Change i to unsigned long.
1999-07-02 * dwarf2.c (parse_comp_unit): Add ABBREV_LENGTH parameter.Mark Mitchell1-14/+40
(_bfd_dwarf2_find_nearest_line): Add ADDR_SIZE parameter. * elf.c (_bfd_elf_find_nearest_line): Pass it. * elf32-arm.h (elf32_arm_find_nearest_line): Likewise. * elf32-mips.c (ABI_64_P): New macro. (IRIX_COMPAT): We are IRIX6-compatible if ABI_64_P. (_bfd_mips_elf_find_nearest_line): Adjust call to _bfd_dwarf2_find_nearest_line. * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. * libbfd.h: Regenerated.
1999-06-26David Mosberger <davidm@hpl.hp.com>Richard Henderson1-54/+93
* dwarf2.c (struct arange): New type. (struct comp_unit): Replace LOW and HIGH by member ARANGE. (arange_add): New function. (decode_line_info): Keep track of address ranges that a compilation unit covers. (comp_unit_contains_address): Return true if address is contained in _any_ of the address ranges associated with a compilation unit. (_bfd_dwarf2_find_nearest_line): Call comp_unit_find_nearest_line on the first comp_unit that contains the address.
1999-06-26David Mosberger <davidm@hpl.hp.com>Richard Henderson1-4/+9
* dwarf2.c (struct dwarf2_debug): Add member dwarf_line_buffer. (decode_line_info): Add variable STASH and initialize it to point to the per-bfd dwarf2_debug info. Remove static variable dwarf_line_buffer and use stash->dwarf_line_buffer in its place.
1999-06-10 * dwarf2.c (decode_line_info): Remove unused variable first_time.Ian Lance Taylor1-1/+0
1999-06-03David Mosberger <davidm@hpl.hp.com>Richard Henderson1-30/+110
* dwarf2.c (struct line_info): Add member END_SEQUENCE to keep track of end_sequence markers. (add_line_info): Add END_SEQUENCE arg. (decode_line_info): Don't try to infer lo_pc and hi_pc from the debug-line info---it doesn't work right if a compilation unit consists of multiple discontiguous code-sequences. It would be worthwhile to optimize for the common case where a compilation unit results in a contiguous set of code sequences, but this is quite tricky to get right for arbitrary DWARF2 files. (lookup_address_in_line_info_table): Don't use the last line entry for a compilation unit for anything with an address higher than this line entry. Also, check for end_sequence markers to correctly handle discontinuities. (_bfd_dwarf2_find_nearest_line): When checking previously loaded compilation units, check all compilation units with each->high==0 just like when reading compilation units. * dwarf2.c (decode_line_info): Initialize table->files and table->last_line to NULL to avoid segfaults due to random values in these members. (concat_filename): Check for out-of-range file number before indexing filename table. Segfaults suck. * dwarf2.c (decode_line_info): Don't truncate address to least significant 32 bits (breaks 64 bit targets). (lookup_address_in_function_table): Ditto. (comp_unit_contains_address): Ditto.
1999-05-06Fred Fish <fnf@be.com>Richard Henderson1-2/+2
* dwarf2.c (read_abbrevs): Change cast of dwarf_abbrev_buffer assignment from "unsigned char *" to "char *". (decode_line_info): Likewise for dwarf_line_buffer assignment.
1999-05-0319990502 sourceware importbinu_ss_19990502Richard Henderson1-0/+1466