aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-03-26Support AT_BSDFLAGS on FreeBSD.John Baldwin4-0/+10
FreeBSD's kernel recently added a new ELF auxiliary vector entry holding a mask of software features provided by the kernel. This change fixes 'info auxv' to report the name and description for this vector entry instead of '???'. include/ChangeLog: * elf/common.h (AT_FREEBSD_BSDFLAGS): Define. gdb/ChangeLog: * fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_BSDFLAGS.
2020-03-26Change two functions to be methods on struct attributeTom Tromey4-60/+86
This changes dwarf2_get_ref_die_offset and dwarf2_get_attr_constant_value to be methods on struct attribute. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (handle_data_member_location, dwarf2_add_field) (mark_common_block_symbol_computed, read_tag_string_type) (attr_to_dynamic_prop, read_subrange_type): Update. (dwarf2_get_ref_die_offset, dwarf2_get_attr_constant_value): Move to be methods on struct attribute. (skip_one_die, process_imported_unit_die, read_namespace_alias) (read_call_site_scope, partial_die_info::read) (partial_die_info::read, lookup_die_type, follow_die_ref): Update. * dwarf2/attribute.c (attribute::get_ref_die_offset): New method, from dwarf2_get_ref_die_offset. (attribute::constant_value): New method, from dwarf2_get_attr_constant_value. * dwarf2/attribute.h (struct attribute) <get_ref_die_offset>: Declare method. <constant_value>: New method.
2020-03-26Move DWARF-constant stringifying code to new fileTom Tromey5-93/+163
This moves the DWARF debugging functions that stringify various constants to a new file, dwarf2/stringify.c. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (dwarf_unit_type_name, dwarf_tag_name) (dwarf_attr_name, dwarf_form_name, dwarf_bool_name) (dwarf_type_encoding_name): Move to stringify.c. * Makefile.in (COMMON_SFILES): Add dwarf2/stringify.c. * dwarf2/stringify.c: New file. * dwarf2/stringify.h: New file.
2020-03-26Rewrite new die_info methodsTom Tromey2-12/+21
This rewrites the two new die_info methods to iterate over attributes rather than to do two separate searches. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/die.h (struct die_info) <addr_base, ranges_base>: Rewrite.
2020-03-26Change two more functions to be methods on die_infoTom Tromey3-31/+37
This changes lookup_addr_base and lookup_ranges_base to be methods on die_info. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/die.h (struct die_info) <addr_base, ranges_base>: New methods. * dwarf2/read.c (lookup_addr_base): Move to die.h. (lookup_ranges_base): Likewise. (read_cutu_die_from_dwo, read_full_die_1): Update.
2020-03-26Remove sibling_dieTom Tromey2-36/+38
The sibling_die helper function does not seem to add much value, considering that many other fields of die_info are directly accessed. So, this removes it. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (read_import_statement, read_file_scope) (read_type_unit_scope, inherit_abstract_dies, read_func_scope) (read_lexical_block_scope, read_call_site_scope) (dwarf2_get_subprogram_pc_bounds, get_scope_pc_bounds) (handle_struct_member_die, process_structure_scope) (update_enumeration_type_from_children) (process_enumeration_scope, read_array_type, read_common_block) (read_namespace, read_module, read_subroutine_type): Update. (sibling_die): Remove.
2020-03-26Change dwarf2_attr_no_follow to be a methodTom Tromey3-29/+27
This changes dwarf2_attr_no_follow to be a method on die_info. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (lookup_addr_base, lookup_ranges_base) (build_type_psymtabs_reader, read_structure_type) (read_enumeration_type, read_full_die_1): Update. (dwarf2_attr_no_follow): Move to die.h. * dwarf2/die.h (struct die_info) <attr>: New method.
2020-03-26Remove dwarf2_cu::base_knownTom Tromey2-30/+25
This removes dwarf2_cu::base_known, changing base_address to be a gdb::optional. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (struct dwarf2_cu) <base_known>: Remove. <base_address>: Now an optional. (dwarf2_find_base_address, dwarf2_rnglists_process) (dwarf2_ranges_process, fill_in_loclist_baton) (dwarf2_symbol_mark_computed): Update.
2020-03-26Move die_info to new headerTom Tromey3-39/+68
This moves struct die_info to a new header, dwarf2/die.h. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (struct die_info): Move to die.h. * dwarf2/die.h: New file.
2020-03-26Move more code to line-header.cTom Tromey4-329/+368
This moves some more code out of read.c and into line-header.c. dwarf_decode_line_header is split into two -- the part remaining in read.c handles interfacing to the dwarf2_cu; while the part in line-header.c (more or less) purely handles the actual decoding. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/line-header.h (dwarf_decode_line_header): Declare. * dwarf2/read.c (dwarf2_statement_list_fits_in_line_number_section_complaint): Move to line-header.c. (read_checked_initial_length_and_offset, read_formatted_entries): Likewise. (dwarf_decode_line_header): Split into two. * dwarf2/line-header.c (dwarf2_statement_list_fits_in_line_number_section_complaint): Move from read.c. (read_checked_initial_length_and_offset, read_formatted_entries): Likewise. (dwarf_decode_line_header): New function, split from read.c.
2020-03-26Convert read_indirect_line_string to a methodTom Tromey3-20/+29
This changes read_indirect_line_string to be a method on dwarf2_per_objfile. This makes it a bit simpler to share between files. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.h (struct dwarf2_per_objfile) <read_line_string>: Declare method. * dwarf2/read.c (read_attribute_value): Update. (dwarf2_per_objfile::read_line_string): Rename from read_indirect_line_string. (read_formatted_entries): Update.
2020-03-26Trivial fix in dwarf_decode_macro_bytesTom Tromey2-3/+8
One spot in dwarf_decode_macro_bytes could use the existing "objfile" local variable. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/macro.c (dwarf_decode_macro_bytes): Use objfile local variable.
2020-03-26Use a const dwarf2_section_info in macro readerTom Tromey3-6/+15
This changes the DWARF macro reader to use a const dwarf2_section_info. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/macro.h (dwarf_decode_macros): Make section parameter const. * dwarf2/macro.c (skip_form_bytes, skip_unknown_opcode) (dwarf_decode_macro_bytes, dwarf_decode_macros): Make section parameter const.
2020-03-26Use a const line_header in macro readerTom Tromey4-5/+12
This changes the DWARF macro reader to use a const line_header. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (dwarf_decode_macros): Make "lh" const. * dwarf2/macro.h (dwarf_decode_macros): Constify "lh" parameter. * dwarf2/macro.c (macro_start_file): Constify "lh" parameter. (dwarf_decode_macro_bytes, dwarf_decode_macros): Likewise.
2020-03-26Make some line_header methods constTom Tromey3-6/+24
This changes a few line_header methods to be const. In some cases, a const overload is added. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/line-header.h (struct line_header) <is_valid_file_index, file_names_size, file_full_name, file_file_name>: Use const. <file_name_at, file_names>: Add const overload. * dwarf2/line-header.c (line_header::file_file_name) (line_header::file_full_name): Update.
2020-03-26Move code to new file dwarf2/macro.cTom Tromey5-830/+914
This moves some more code out of dwarf2/read.c, introducing new files dwarf2/macro.c and dwarf2/macro.h. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (dwarf2_macro_malformed_definition_complaint) (macro_start_file, consume_improper_spaces) (parse_macro_definition, skip_form_bytes, skip_unknown_opcode) (dwarf_parse_macro_header, dwarf_decode_macro_bytes) (dwarf_decode_macros): Move to macro.c. * dwarf2/macro.c: New file. * dwarf2/macro.h: New file. * Makefile.in (COMMON_SFILES): Add dwarf2/macro.c.
2020-03-26Add dwarf2_section_info::read_string methodTom Tromey4-49/+46
This moves a string-reading function to be a method on dwarf2_section_info, and then updates the users. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/section.h (struct dwarf2_section_info) <read_string>: New method. * dwarf2/section.c: New method. From read_indirect_string_at_offset_from. * dwarf2/read.c (mapped_debug_names::namei_to_name): Update. (read_indirect_string_at_offset_from): Move to section.c. (read_indirect_string_at_offset): Rewrite. (read_indirect_line_string_at_offset): Remove. (read_indirect_string, read_indirect_line_string) (dwarf_decode_macro_bytes): Update.
2020-03-26Convert dwarf2_section_buffer_overflow_complaint to a methodTom Tromey4-11/+21
This changes dwarf2_section_buffer_overflow_complaint to be a method on dwarf2_section_info. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/section.h (struct dwarf2_section_info) <overload_complaint>: Declare. (dwarf2_section_buffer_overflow_complaint): Don't declare. * dwarf2/section.c (dwarf2_section_info::overflow_complaint): Rename from dwarf2_section_buffer_overflow_complaint. * dwarf2/read.c (skip_one_die, partial_die_info::read) (skip_form_bytes, dwarf_decode_macro_bytes): Update.
2020-03-26Move dwarf2_section_buffer_overflow_complaint to dwarf2/section.cTom Tromey4-9/+22
This moves dwarf2_section_buffer_overflow_complaint to dwarf2/section.c. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/section.h (dwarf2_section_buffer_overflow_complaint): Declare. * dwarf2/section.c (dwarf2_section_buffer_overflow_complaint): Move from read.c. * dwarf2/read.c (dwarf2_section_buffer_overflow_complaint): Move to section.c.
2020-03-26Split dwarf_decode_macros into two overloadsTom Tromey2-43/+63
This splits dwarf_decode_macros into two overloads -- one that's suitable for splitting into a separate file, and one that finds the correct section and should remain in dwarf2/read.c. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (dwarf_decode_macros): Split into two overloads.
2020-03-26Change dwarf_decode_macro_bytes calling conventionTom Tromey2-10/+21
This changes dwarf_decode_macro_bytes to accept a buildsym_compunit rather than a dwarf2_cu. This enables some subsequent changes; and also makes the function accept a "more specific" parameter. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (macro_start_file): Change "cu" parameter to "builder". (dwarf_decode_macro_bytes): Likewise. Add dwarf2_per_objfile parameter. (dwarf_decode_macros): Update.
2020-03-26Add dwz.c and dwz_file::read_stringTom Tromey5-32/+60
This changes read_indirect_string_from_dwz to be a method on the dwz_file, and adds a new dwarf2/dwz.c file. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.c (read_attribute_value): Update. (read_indirect_string_from_dwz): Move to dwz.c; change into method. (dwarf_decode_macro_bytes): Update. * dwarf2/dwz.h (struct dwz_file) <read_string>: Declare method. * dwarf2/dwz.c: New file. * Makefile.in (COMMON_SFILES): Add dwz.c.
2020-03-26Introduce dwarf2/dwz.hTom Tromey6-31/+69
This moves "struct dwz_file" to a new header file, dwarf2/dwz.h. gdb/ChangeLog 2020-03-26 Tom Tromey <tom@tromey.com> * dwarf2/read.h (struct dwz_file): Move to dwz.h. * dwarf2/read.c: Add include. * dwarf2/index-write.c: Add include. * dwarf2/index-cache.c: Add include. * dwarf2/dwz.h: New file.
2020-03-26Revert earlier delta adding bfd_coff_get_internal_extra_pe_aouthdr() function.Nick Clifton4-19/+7
* cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete. * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove prototype. * libbfd.h: Regenerate.
2020-03-26Re: H8300 use of uninitialised valueAlan Modra4-126/+152
This patch also had some problems. Calculation of maxlen was wrong, and the insn arg loop needed rearranging to work with a correct length. * disassemble.h (opcodes_assert): Declare. (OPCODES_ASSERT): Define. * disassemble.c: Don't include assert.h. Include opintl.h. (opcodes_assert): New function. * h8300-dis.c (bfd_h8_disassemble_init): Use OPCODES_ASSERT. (bfd_h8_disassemble): Reduce size of data array. Correctly calculate maxlen. Omit insn decoding when insn length exceeds maxlen. Exit from nibble loop when looking for E, before accessing next data byte. Move processing of E outside loop. Replace tests of maxlen in loop with assertions.
2020-03-26Re: i386msdos uninitialised readAlan Modra2-1/+5
Another fix. * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
2020-03-26Re: ARC: Use of uninitialised valueAlan Modra2-2/+6
git commit beea5cc1bc fixed one use of an uninitialised value but ignored another one a few lines later. * arc-dis.c (find_format): Init needs_limm. Simplify use of limm.
2020-03-26alpha-vms: Sanity check ETIR__C_CTL_DFLOC indexAlan Modra2-9/+23
I doubt anyone will want to create more than 16M debug location entries. If there is no bound the object format allows for 32-bit indices and of course fuzzers find that and attempt allocation of up to a 16G byte array. The patch also fixes potential integer overflows in calculating the array size. * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets array. (_bfd_vms_slurp_object_records): Rename "err" to "ok".
2020-03-26Automatic date update in version.inGDB Administrator1-1/+1
2020-03-25Fix error message in compile-object-load.cTom Tromey2-1/+6
I noticed that an error message in compile-object-load.c mentions the wrong symbol name. The loop just above the error is looking for COMPILE_I_EXPR_VAL, but the error references COMPILE_I_EXPR_PTR_TYPE. I'm checking this in as obvious. I don't have a test case -- I noticed it because another patch I'm working on caused this error to be thrown, but that was due to regression in my patch. gdb/ChangeLog 2020-03-25 Tom Tromey <tom@tromey.com> * compile/compile-object-load.c (get_out_value_type): Mention correct symbol name in error message.
2020-03-25Fix WOW64 process system DLL pathsHannes Domani2-3/+45
GetModuleFileNameEx returns for some DLLs of WOW64 processes the path inside the 64bit system directory instead of the 32bit syswow64 directory. Problem happens e.g. with dbghelp.dll: (gdb) start Temporary breakpoint 1 at 0x415a00: file fiber.cpp, line 430. Starting program: C:\src\tests\fiber.exe warning: `C:\Windows\system32\dbghelp.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386. Temporary breakpoint 1, main () at fiber.cpp:430 430 { (gdb) info sharedlibrary From To Syms Read Shared Object Library 0x77070000 0x771d4d20 Yes (*) C:\Windows\SysWOW64\ntdll.dll 0x74dc0000 0x74ebad9c Yes (*) C:\Windows\syswow64\kernel32.dll 0x75341000 0x75386a18 Yes (*) C:\Windows\syswow64\KernelBase.dll 0x6f6a1000 0x6f7c48fc Yes (*) C:\Windows\system32\dbghelp.dll 0x74d01000 0x74dab2c4 Yes (*) C:\Windows\syswow64\msvcrt.dll (*): Shared library is missing debugging information. This detects this situation and converts the DLL path to the syswow64 equivalent. gdb/ChangeLog: 2020-03-25 Hannes Domani <ssbssa@yahoo.de> * windows-nat.c (windows_add_all_dlls): Fix system dll paths.
2020-03-25readelf looping in process_archiveAlan Modra2-2/+8
With a crafted "negative" ar_hdr.ar_size it is possible to make readelf loop. This patch catches the overflow in a file offset calculation. * readelf.c (process_archive): Prevent endless loop.
2020-03-25Add a new function to the BFD library to allow users access to the COFF ↵Nick Clifton4-0/+26
internal_extra_pe_outhdr structure. * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New function. * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype. * libbfd.h: Regenerate.
2020-03-25The "b" flag for COFF sections only unsets the LOAD attribute. It should ↵J.W. Jagersma2-0/+10
also clear the CONTENTS attribute so that named bss sections don't take up space in an object file. This can be achieved by setting the 'bss' flag in seg_info. * config/obj-coff.c (obj_coff_section): Set the bss flag on sections with the "b" attribute.
2020-03-25[gdb] Print user/includes fields for maint commandsTom de Vries3-3/+64
The type struct compunit_symtab contains two fields (disregarding field next) that express relations with other compunit_symtabs: user and includes. These fields are currently not printed with "maint info symtabs" and "maint print symbols". Fix this such that for "maint info symtabs" we print: ... { ((struct compunit_symtab *) 0x23e8450) debugformat DWARF 2 producer (null) dirname (null) blockvector ((struct blockvector *) 0x23e8590) + user ((struct compunit_symtab *) 0x2336280) + ( includes + ((struct compunit_symtab *) 0x23e85e0) + ((struct compunit_symtab *) 0x23e8960) + ) { symtab <unknown> ((struct symtab *) 0x23e85b0) fullname (null) linetable ((struct linetable *) 0x0) } } ... And for "maint print symbols" we print: ... -Symtab for file <unknown> +Symtab for file <unknown> at 0x23e85b0 Read from object file /data/gdb_versions/devel/a.out (0x233ccf0) Language: c Blockvector: block #000, object at 0x23e8530, 0 syms/buckets in 0x0..0x0 block #001, object at 0x23e84d0 under 0x23e8530, 0 syms/buckets in 0x0..0x0 +Compunit user: 0x2336300 +Compunit include: 0x23e8900 +Compunit include: 0x23dd970 ... Note: for user and includes we don't list the actual compunit_symtab address, but instead the corresponding symtab address, which allows us to find that symtab elsewhere in the output (given that we also now print the address of symtabs). gdb/ChangeLog: 2020-03-25 Tom de Vries <tdevries@suse.de> * symtab.h (is_main_symtab_of_compunit_symtab): New function. * symmisc.c (dump_symtab_1): Print user and includes fields. (maintenance_info_symtabs): Same.
2020-03-25gdb/riscv: Apply NaN boxing when writing return values into registersAndrew Burgess2-29/+48
When setting up function parameters we already perform NaN boxing, as required by the RISC-V ABI, however, we don't do this when writing values into registers as part of setting up a return value. This commit moves the NaN boxing code into a small helper function, and then makes use of this function when setting up function parameters, and also when setting up return values. This should resolve this failure: FAIL: gdb.base/return-nodebug.exp: float: full width of the returned result gdb/ChangeLog: PR gdb/25489 * riscv-tdep.c (riscv_arg_info::c_offset): Update comment. (riscv_regcache_cooked_write): New function. (riscv_push_dummy_call): Use new function. (riscv_return_value): Likewise.
2020-03-25arc: Use correct string when printing bfd DEBUG dataShahab Vahedi2-2/+7
PRINT_DEBUG_RELOC_INFO_BEFORE() macro prints bunch of parameters for debugging purposes. Due to a seemingly copy/paste mistake, the "input_section->vma" is printed under the field name "symbol_section->vma". This commit fixes that. This fix is a courtesy of xiangzhai. * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the correct field name in the output string.
2020-03-25h8300-linux ld testsuiteAlan Modra90-42/+203
This fixes lots of fails caused by h8300-linux not supporting -shared and related options. I've also fixed ld-h8300 tests to accept the valid h8300-linux -m options . pr22450.d is also fixed for avr, crx, ip2k, m68hc11 and xc16x, and the new pr25708 test for hppa64. * testsuite/ld-elf/compress1c.d: xfail h8300. * testsuite/ld-elf/compressed1c.d: Likewise. * testsuite/ld-elf/compressed1e.d: Likewise. * testsuite/ld-elf/dynamic1.d: Likewise. * testsuite/ld-elf/dynsym1.d: Likewise. * testsuite/ld-elf/ehdr_start-shared.d: Likewise. * testsuite/ld-elf/exclude3b.d: Likewise. * testsuite/ld-elf/export-class.exp: Don't run without -shared support. * testsuite/ld-elf/global1.d: xfail h8300. * testsuite/ld-elf/hash.d: Likewise. * testsuite/ld-elf/loadaddr1.d: Likewise. * testsuite/ld-elf/loadaddr2.d: Likewise. * testsuite/ld-elf/local1.d: Likewise. * testsuite/ld-elf/mbind1b.d: Likewise. * testsuite/ld-elf/mbind1c.d: Likewise. * testsuite/ld-elf/now-1.d: Likewise. * testsuite/ld-elf/now-2.d: Likewise. * testsuite/ld-elf/now-3.d: Likewise. * testsuite/ld-elf/now-4.d: Likewise. * testsuite/ld-elf/pie.d: Likewise. * testsuite/ld-elf/pr12975.d: Likewise. * testsuite/ld-elf/pr13177.d: Likewise. * testsuite/ld-elf/pr13195.d: Likewise. * testsuite/ld-elf/pr16322.d: Likewise. * testsuite/ld-elf/pr16498a.d: Likewise. * testsuite/ld-elf/pr16498b.d: Likewise. * testsuite/ld-elf/pr17615.d: Likewise. * testsuite/ld-elf/pr19162.d: Likewise. * testsuite/ld-elf/pr19539.d: Likewise. * testsuite/ld-elf/pr19617a.d: Likewise. * testsuite/ld-elf/pr19698.d: Likewise. * testsuite/ld-elf/pr20513c.d: Likewise. * testsuite/ld-elf/pr20513d.d: Likewise. * testsuite/ld-elf/pr21389a.d: Likewise. * testsuite/ld-elf/pr21389b.d: Likewise. * testsuite/ld-elf/pr21389c.d: Likewise. * testsuite/ld-elf/pr21562a.d: Likewise. * testsuite/ld-elf/pr21562b.d: Likewise. * testsuite/ld-elf/pr21562c.d: Likewise. * testsuite/ld-elf/pr21562d.d: Likewise. * testsuite/ld-elf/pr21562e.d: Likewise. * testsuite/ld-elf/pr21562f.d: Likewise. * testsuite/ld-elf/pr21562g.d: Likewise. * testsuite/ld-elf/pr21562h.d: Likewise. * testsuite/ld-elf/pr21562i.d: Likewise. * testsuite/ld-elf/pr21562j.d: Likewise. * testsuite/ld-elf/pr21562k.d: Likewise. * testsuite/ld-elf/pr21562l.d: Likewise. * testsuite/ld-elf/pr21562m.d: Likewise. * testsuite/ld-elf/pr21562n.d: Likewise. * testsuite/ld-elf/pr21903a.d: Likewise. * testsuite/ld-elf/pr21903b.d: Likewise. * testsuite/ld-elf/pr21903d.d: Likewise. * testsuite/ld-elf/pr22269a.d: Likewise. * testsuite/ld-elf/pr22269b.d: Likewise. * testsuite/ld-elf/pr22393-1a.d: Likewise. * testsuite/ld-elf/pr22393-1b.d: Likewise. * testsuite/ld-elf/pr22393-1c.d: Likewise. * testsuite/ld-elf/pr22393-1d.d: Likewise. * testsuite/ld-elf/pr22393-1e.d: Likewise. * testsuite/ld-elf/pr22393-1f.d: Likewise. * testsuite/ld-elf/pr22423.d: Likewise. * testsuite/ld-elf/pr22450.d: xfail avr, crx, h8300, ip2k, m68hc11, and xc16x. * testsuite/ld-elf/pr23658-1c.d: xfail h8300. * testsuite/ld-elf/pr25708.d: xfail h8300 and hppa64. * testsuite/ld-elf/rpath-1.d: xfail h8300. * testsuite/ld-elf/rpath-2.d: Likewise. * testsuite/ld-elf/runpath-1.d: Likewise. * testsuite/ld-elf/runpath-2.d: Likewise. * testsuite/ld-elf/sizeofb.d: Likewise. * testsuite/ld-elf/startofb.d: Likewise. * testsuite/ld-elf/strtab.d: Likewise. * testsuite/ld-elf/textaddr1.d: Likewise. * testsuite/ld-elf/textaddr2.d: Likewise. * testsuite/ld-elf/textaddr4.d: Likewise. * testsuite/ld-elf/textaddr5.d: Likewise. * testsuite/ld-elf/textaddr6.d: Likewise. * testsuite/ld-elf/unknown2.d: Likewise. * testsuite/ld-undefined/entry-3.d: Likewise. * testsuite/ld-undefined/entry-4.d: Likewise. * testsuite/ld-h8300/h8300.exp: Pass appropriate ld -m option. * testsuite/ld-h8300/gcsection.d: Remove ld -m option and relax file format match. * testsuite/ld-h8300/relax-2.d: Likewise. * testsuite/ld-h8300/relax-3.d: Likewise. * testsuite/ld-h8300/relax-4.d: Likewise. * testsuite/ld-h8300/relax-5.d: Likewise. * testsuite/ld-h8300/relax-6.d: Likewise. * testsuite/ld-h8300/relax-7.d: Likewise. * testsuite/ld-h8300/relax.d: Relax file format match.
2020-03-25PR25662, invalid sh_offset for first section in segment with phdrsAlan Modra2-3/+25
PR 25662 * elf.c (assign_file_positions_for_load_sections): Adjust offset for SHT_NOBITS section if first in segment.
2020-03-25Automatic date update in version.inGDB Administrator1-1/+1
2020-03-24bfd: Add a bfd_boolean argument to bfd_get_symbol_version_stringH.J. Lu11-25/+43
We can't call _bfd_elf_get_symbol_version_name from nm.c since it isn't available for all target configurations. This patch add a bfd_boolean argument to bfd_get_symbol_version_string instead. bfd/ PR binutils/25708 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ... (_bfd_elf_get_symbol_version_string): This. * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ... (_bfd_elf_get_symbol_version_string): This. (bfd_elf_print_symbol): Pass TRUE to _bfd_elf_get_symbol_version_string. * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a bfd_boolean argument. * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise. * targets.c (_bfd_get_symbol_version_string): Likewise. (bfd_get_symbol_version_string): Likewise. * bfd-in2.h: Regenerated. binutils/ PR binutils/25708 * nm.c (print_symname): Replace _bfd_elf_get_symbol_version_name with bfd_get_symbol_version_string. (print_symbo): Pass TRUE to bfd_get_symbol_version_string. * objdump.c (objdump_print_symname): Likewise.
2020-03-25Uninitialised memory read in z80-dis.cAlan Modra2-0/+5
objdump -d -m ez80-adl testcase: .byte 0x40,0xfd * z80-dis.c (suffix): Init mybuf.
2020-03-24gdb: bool-ify follow_forkSimon Marchi12-53/+64
Change parameters and return value of the various follow_fork functions/methods from int to bool. gdb/ChangeLog: * fbsd-nat.c (fbsd_nat_target::follow_fork): Change bool to int. * fbsd-nat.h (class fbsd_nat_target) <follow_fork>: Likewise. * inf-ptrace.c (inf_ptrace_target::follow_fork): Likewise. * inf-ptrace.h (struct inf_ptrace_target) <follow_fork>: Likewise. * infrun.c (follow_fork): Likewise. (follow_fork_inferior): Likewise. * linux-nat.c (linux_nat_target::follow_fork): Likewise. * linux-nat.h (class linux_nat_target): Likewise. * remote.c (class remote_target) <follow_fork>: Likewise. (remote_target::follow_fork): Likewise. * target-delegates.c: Re-generate. * target.c (default_follow_fork): Likewise. (target_follow_fork): Likewise. * target.h (struct target_ops) <follow_fork>: Likewise. (target_follow_fork): Likewise.
2020-03-24Update changelog.Nick Clifton1-0/+1
2020-03-24Add code to the BFD library to handle opening files with pathnames longer ↵Nick Clifton2-11/+31
than MAX_PATH on Win32 systems. PR 25713 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on Win32 systems.
2020-03-24Fix assertion failure in the BFD library when linking with --emit-relocs ↵Nick Clifton2-3/+13
enabled. PR 25681 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a segment to use for PT_GNU_RELRO, ignore empty sections in a segment's current list.
2020-03-24bfd: Change num_group to unsigned intH.J. Lu2-1/+6
elf.c failed with to with GCC 10 as of commit 906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536 Author: Martin Liska <mliska@suse.cz> Date: Tue Mar 24 11:40:10 2020 +0100 Improve endianess detection. PR lto/94249 * plugin-api.h: Add more robust endianess detection. binutils-gdb/bfd/elf.c: In function ‘setup_group’: binutils-gdb/bfd/elf.c:740:35: error: overflow in conversion from ‘unsigned int’ to ‘int’ changes value from ‘num_group = 4294967295’ to ‘-1’ [-Werror=overflow] 740 | elf_tdata (abfd)->num_group = num_group = -1; | ^~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [Makefile:1608: elf.lo] Error 1 Change num_group in elf_obj_tdata to unsigned int to compile with GCC 10. PR binutils/25717 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
2020-03-24include: Sync plugin-api.h with GCCMartin Liska2-2/+68
Improve endianess detection. PR lto/94249 * plugin-api.h: Add more robust endianess detection.
2020-03-24bfd: Display symbol version for nm -DH.J. Lu7-12/+77
Extend _bfd_elf_get_symbol_version_string for nm -D to display symbol version. _bfd_elf_get_symbol_version_name is added to avoid updating all XXX_get_symbol_version_string functions. bfd/ PR binutils/25708 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New. * elf.c (_bfd_elf_get_symbol_version_name): New function. Based on the previous _bfd_elf_get_symbol_version_string. (_bfd_elf_get_symbol_version_string): Use it. binutils/ PR binutils/25708 * nm.c (SYM_NAME): Removed. (print_symname): Add a pointer to struct extended_symbol_info argument. Call _bfd_elf_get_symbol_version_name to get symbol version. (print_symdef_entry): Pass NULL to print_symname. (print_symbol_info_bsd): Update call to print_symname. (print_symbol_info_sysv): Likewise. (print_symbol_info_posix): Likewise. ld/ PR binutils/25708 * testsuite/ld-elf/pr25708.d: New file.
2020-03-24[gdb] Print user for maint info psymtabsTom de Vries2-0/+9
The type struct partial_symtab contains two fields (disregarding field next) that express relations with other symtabs: user and dependencies. When using "maint print psymbols", we see both the dependencies and the user fields: ... Partial symtab for source file (object 0x35ef270) ... Depends on 0 other partial symtabs. Shared partial symtab with user 0x35d5f40 ... But with "maint info psymtabs", we only see dependencies: ... { psymtab ((struct partial_symtab *) 0x35ef270) ... dependencies (none) } ... Add printing of the user field for "maint info psymtabs", such that we have: ... { psymtab ((struct partial_symtab *) 0x35ef270) ... + user hello.c ((struct partial_symtab *) 0x35d5f40) dependencies (none) } ... Tested on x86_64-linux. gdb/ChangeLog: 2020-03-24 Tom de Vries <tdevries@suse.de> * psymtab.c (maintenance_info_psymtabs): Print user field.