summaryrefslogtreecommitdiff
path: root/bfd/dwarf2.c
Commit message (Collapse)AuthorAgeFilesLines
* * dwarf2.c (_bfd_dwarf2_find_nearest_line): Fix typo inAlexandre Oliva2003-04-161-1/+1
| | | | 2003-04-09's change.
* * dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standardAlexandre Oliva2003-04-091-17/+25
| | | | | and IRIX-specific shift-to-64-bit 4-byte lengths before following addr_size.
* * dwarf2.c (read_attribute_value): Correct typo in comment.Ben Elliston2003-04-011-1/+1
|
* Make add_line_info() take a copy of the filename.Nick Clifton2003-04-011-1/+10
|
* Remove use of concat() inside concat_filename()Nick Clifton2003-04-011-18/+27
|
* * simple.c (bfd_simple_get_relocated_section_contents): AddDaniel Jacobowitz2003-04-011-100/+14
| | | | | | | | | | | | | | | | | | | | | parameter symbol_table. Optionally use it instead of the symbol table from the bfd. Save and restore output offsets and output sections around bfd_get_relocated_section_contents. Fix a memory leak. (simple_save_output_info, simple_restore_output_info): New functions. * bfd-in2.h: Regenerate. * dwarf2.c (read_abbrevs): Use bfd_simple_get_relocated_section_contents instead of bfd_get_section_contents. (decode_line_info): Likewise. (_bfd_dwarf2_find_nearest_line): Likewise. Don't call find_rela_addend. (find_rela_addend): Remove. * elfxx-ia64.c (elfNN_ia64_reloc): Weaken sanity check for debugging sections. (elfNN_ia64_hash_table_create): Create the hash table with malloc, not bfd_zalloc.
* Fix memory leaksNick Clifton2003-03-311-6/+14
|
* Comment typo fixes.Alan Modra2002-12-121-1/+1
|
* s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. SimplifyAlan Modra2002-11-301-46/+46
| | | | comparisons of bfd_boolean vars with TRUE/FALSE. Formatting.
* * dwarf2.c: Revert last change.Alan Modra2002-11-071-8/+8
|
* Use bfd_simple_get_relocated_section_contents() instead of ↵Nick Clifton2002-11-071-8/+8
| | | | bfd_get_section_contents().
* * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index toDave Anglin2002-10-251-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.
* * dwarf2.c (add_line_info): Ensure that the line_info_table isAlan Modra2002-10-231-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.
* Fix typo introduced with previous delta.Nick Clifton2002-09-241-2/+1
|
* Update to correctly decode (non-standard DWARF2) out-of-order address sequences.Nick Clifton2002-09-231-63/+61
|
* (_bfd_dwarf2_find_nearest_line): If address length is zero, set it to 8 forNick Clifton2002-09-201-0/+7
| | | | (non-standard) 64-bit DWARF2 formats (e.g. IRIX64).
* From: Ian Rickards <irickard@arm.com>Richard Earnshaw2002-07-171-2/+7
| | | | | * dwarf2.c (concat_filename): If we can't establish the directory just return the filename.
* 2002-06-27 Kevin Buettner <kevinb@redhat.com>Alan Modra2002-06-271-12/+8
| | | | | * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit DWARF2 formats.
* Check unit->addr_size to read in the proper number of prologue bytes.Nick Clifton2002-06-251-3/+14
|
* * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate codeAlan Modra2002-05-041-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-20 Daniel Jacobowitz <drow@mvista.com>Daniel Jacobowitz2002-03-201-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.
* Use full section name in error messages.Nick Clifton2002-01-301-10/+7
|
* * dwarf2.c (struct line_head) [total_length]: Change type toJakub Jelinek2001-11-141-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.
* * dwarf2.c (read_attribute_value): New function to handleRichard Henderson2001-11-131-8/+28
| | | | | DW_FORM_indirect. (read_attribute): Use it.
* Index: bfd/ChangeLogGeoffrey Keating2001-11-131-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.
* * dwarf2.c (comp_unit_find_nearest_line): Check for end ofStephane Carrez2001-10-061-1/+2
| | | | compilation unit.
* Touches most files in bfd/, so likely will be blamed for everything..Alan Modra2001-09-181-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.
* * coff-rs6000.c: Add missing prototypes.Alan Modra2001-08-091-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.
* * dwarf2.c (struct dwarf2_debug): Add sec, sec_info_ptr and syms.Alexandre Oliva2001-08-081-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.
* * dwarf2.c (decode_line_info): Fix error message.Andreas Jaeger2001-05-211-3/+3
| | | | | (read_abbrevs): Fix test for offset as suggested by Alan Modra and adjust error message.
* Update copyright noticesNick Clifton2001-03-081-1/+2
|
* 2001-01-23 Kazu Hirata <kazu@hxi.com>Kazu Hirata2001-01-231-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.
* Generalize DWARF2 and COFF support.Nick Clifton2000-12-081-25/+30
|
* 2000-11-16 Kazu Hirata <kazu@hxi.com>Kazu Hirata2000-11-161-70/+70
| | | | | * dwarf1.c: Fix formatting. * dwarf2.c: Likewise.
* Find all sections containing debug information and include them in the stash.Nick Clifton2000-09-021-188/+217
|
* K&R compiler fixesAlan Modra2000-04-191-2/+2
|
* Fix linker segfault that occured when linking ia64-linux kernel.Jim Wilson2000-04-071-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.
* * dwarf2.c (read_abbrevs): Use _raw_size directly rather thanIan Lance Taylor2000-02-281-3/+3
| | | | | | calling bfd_get_section_size_before_reloc. (decode_line_info): Likewise. (_bfd_dwarf2_find_nearest_line): Likewise.
* fix typo in previous deltaNick Clifton2000-02-231-1/+1
|
* Accept 16-bit addresses.Nick Clifton2000-02-231-11/+13
|
* * dwarf2.c (read_attribute): Support DW_FORM_ref8.Mark Mitchell1999-07-141-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.
* * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSEDIan Lance Taylor1999-07-111-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.
* * dwarf2.c (parse_comp_unit): Add ABBREV_LENGTH parameter.Mark Mitchell1999-07-021-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.
* David Mosberger <davidm@hpl.hp.com>Richard Henderson1999-06-261-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.
* David Mosberger <davidm@hpl.hp.com>Richard Henderson1999-06-261-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.
* * dwarf2.c (decode_line_info): Remove unused variable first_time.Ian Lance Taylor1999-06-101-1/+0
|
* David Mosberger <davidm@hpl.hp.com>Richard Henderson1999-06-031-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.
* Fred Fish <fnf@be.com>Richard Henderson1999-05-061-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.
* Initial revisionRichard Henderson1999-05-031-0/+1466