Commit Graph

2913 Commits

Author SHA1 Message Date
Jan Kratochvil 9dfd0db952 Fix compilation with GCC 4.4.7.
binutils/
2017-02-27  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix compilation with GCC 4.4.7.
	* dwarf.c (display_loclists_list, display_debug_rnglists_list):
	Initialize begin and end.
2017-02-27 23:22:53 +01:00
Rudy Y 47612ae91c Add symbol called __nm_<name> to exported symbols created by dlltool.
PR 20881
	* dlltool.c (secdata): Align .idata$6 on 2 byte boundary.
	(make_one_lib_file): Export a symbol called __nm_<symbol> for use
	with auto-importing.
2017-02-27 15:02:52 +00:00
Alan Modra 3b83ea38cf Fixes for new dw5 test
On some targets, .string does not add a NUL string terminator.

	* testsuite/binutils-all/dw5.S: Replace .string with .asciz.
	Support hpux .comm variant.
	* testsuite/binutils-all/readelf.exp: Define HPUX when assembling
	dw5 test for hppa64-hpux.
2017-02-25 19:13:23 +10:30
Nick Clifton 6b4bf3bc35 Fix snafu with booleans in readelf patch - lack of a program header is not a reason for a function to return false.
(process_program_headers): Fix snafu - if the program headers are
	not available then this is not a cause to fail.
	(process_corefile_note_segments): Likewise.
2017-02-24 18:15:12 +00:00
Nick Clifton 32ec889602 Tidy up readelf's use of boolean values.
* readelf.c (show_name, do_dynamic, do_syms, do_dyn_syms,
	(do_reloc, do_sections, do_section_groups, do_section_details,
	(do_segments, do_unwind, do_using_dynamic, do_header, do_dump,
	(do_version, do_histogram, do_debugging, do_arch, do_notes,
	(do_archive_index, is_32bit_elf, decompress_dumps): Use
	bfd_boolean type.
	(parse_args): Treat the do_* variables as booleans.
	(print_vma): Return an unsigned int.
	(print_symbol): Change width parameter to signed int.
	(is_ia64_vms): Change return type to bfd_boolean.
	(guess_is_rela): Likewise.
	(slurp_rela_relocs): Likewise.
	(slurp_rel_relocs): Likewise.
	(dump_relocations): Likewise.
	(process_file_header): Likewise.
	(get_program_headers): Likewise.
	(process_program_headers): Likewise.
	(process_section_headers): Likewise.
	(process_section_groups): Likewise.
	(dump_ia64_vms_dynamic_fixups): Likewise.
	(dump_ia64_vms_dynamic_relocs): Likewise.
	(process_ia64_vms_dynamic_relocs): Likewise.
	(process_relocs): Likewise.
	(dump_ia64_unwind): Likewise.
	(ia64_process_unwind): Likewise.
	(dump_hppa_unwind): Likewise.
	(slurp_hppa_unwind_table): Likewise.
	(hppa_process_unwind): Likewise.
	(decode_arm_unwind_bytecode): Likewise.
	(decode_tic6x_unwind_bytecode): Likewise.
	(decode_arm_unwind): Likewise.
	(dump_arm_unwind): Likewise.
	(arm_process_unwind): Likewise.
	(process_unwind): Likewise.
	(get_32bit_dynamic_section): Likewise.
	(get_64bit_dynamic_section): Likewise.
	(process_dynamic_section): Likewise.
	(process_version_sections): Likewise.
	(process_symbol_table): Likewise.
	(process_syminfo): Likewise.
	(apply_relocations): Likewise.
	(disassemble_section): Likewise.
	(dump_section_as_strings): Likewise.
	(dump_section_as_bytes): Likewise.
	(load_specific_debug_section): Likewise.
	(load_debug_section): Likewise.
	(display_debug_section): Likewise.
	(process_section_contents): Likewise.
	(process_attributes): Likewise.
	(process_nds32_specific): Likewise.
	(process_gnu_liblist): Likewise.
	(print_core_note): Likewise.
	(print_gnu_note): Likewise.
	(print_v850_note): Likewise.
	(process_netbsd_elf_note): Likewise.
	(print_stapsdt_note): Likewise.
	(print_ia64_vms_note): Likewise.
	(process_note): Likewise.
	(process_notes_at): Likewise.
	(process_corefile_note_segments): Likewise.
	(process_v850_notes): Likewise.
	(process_note_sections): Likewise.
	(process_notes): Likewise.
	(process_arch_specific): Likewise.
	(get_file_header): Likewise.
	(process_object): Likewise.
	(process_archive): Likewise.
	(process_file): Likewise.
	(section_subset): Make static.
	(get_mips_reg_size): Return a signed integer.
	(process_object): Reverse the logic of the return value.
	(process_archive): Likewise.
	(process_file): Likewise.
2017-02-24 14:48:19 +00:00
Maciej W. Rozycki 7bb1ad1738 readelf: Correct version flag formatting
Remove a trailing space or a leading pipe character from version flags
printed with `readelf --version-info'.

For example with the `mips-linux' target we get:

$ cat ver_def.s
	.data
	.globl	new_foo
	.type	new_foo, %object
new_foo:
	.symver	new_foo, foo@@ver_foo
$ cat ver_def.ver
{ global: *foo*; local: *; };
$ as -o ver_def.o ver_def.s
$ ld -e 0 --export-dynamic --version-script=ver_def.ver -o ver_def ver_def.o
$ readelf -V ver_def

Version symbols section '.gnu.version' contains 4 entries:
 Addr: 000000000000007e  Offset: 0x01007e  Link: 2 (.dynsym)
  000:   0 (*local*)       2 (ver_foo)       1 (*global*)      2 (ver_foo)

Version definition section '.gnu.version_d' contains 2 entries:
  Addr: 0x0000000000000088  Offset: 0x010088  Link: 3 (.dynstr)
  000000: Rev: 1  Flags: BASE   Index: 1  Cnt: 1  Name: ver_def
  0x001c: Rev: 1  Flags: none  Index: 2  Cnt: 1  Name: ver_foo
$

which includes an unnecessary space after `BASE'; both call sites
already provide suitable separation from output that follows.  Also if
only unknown flags were present, then lone `| <unknown>' would be
printed.

	binutils/
	* readelf.c (get_ver_flags): Tidy the formatting of the string
	returned
2017-02-24 13:49:55 +00:00
Maciej W. Rozycki 5235cd6861 readelf: Make version section index sum unsigned
Make `isum' unsigned like data it is calculated from.

	binutils/
	* readelf.c (process_version_sections) <SHT_GNU_verdef>: Make
	`isum' unsigned.
	<SHT_GNU_verneed>: Likewise.
2017-02-24 13:49:11 +00:00
Maciej W. Rozycki c9f02c3e29 readelf: Fix incorrect "Version definition past end of section" message
Fix a commit 74e1a04b97 ("More fixes for reading corrupt ELF files.")
`readelf --version-info' regression that caused "Version definition past
end of section" to be always printed at the end, even with good section
data.

For example with the `mips-linux' target we get:

$ cat ver_def.s
	.data
	.globl	new_foo
	.type	new_foo, %object
new_foo:
	.symver	new_foo, foo@@ver_foo
$ cat ver_def.ver
{ global: *foo*; local: *; };
$ as -o ver_def.o ver_def.s
$ ld -e 0 --export-dynamic --version-script=ver_def.ver -o ver_def ver_def.o
$ readelf -V ver_def

Version symbols section '.gnu.version' contains 4 entries:
 Addr: 000000000000007e  Offset: 0x01007e  Link: 2 (.dynsym)
  000:   0 (*local*)       2 (ver_foo)       1 (*global*)      2 (ver_foo)

Version definition section '.gnu.version_d' contains 2 entries:
  Addr: 0x0000000000000088  Offset: 0x010088  Link: 3 (.dynstr)
  000000: Rev: 1  Flags: BASE   Index: 1  Cnt: 1  Name: ver_def
  0x001c: Rev: 1  Flags: none  Index: 2  Cnt: 1  Name: ver_foo
  Version definition past end of section
$

The cause is the `if (idx + ent.vd_next <= idx)' condition introduced to
ensure forward progress, which however always triggers for good version
definition section data as the last entry will have its `vd_next' value
set to 0.

Adjust the condition then, to say `if (idx + ent.vd_next < idx)' instead
and to ensure forward progress limit the number of entries processed to
the size of the version definition section, removing the problematic
message from output quoted above, while ensuring the original PR 17531
test case is still handled gracefully.

Add a suitable test case so that we have `readelf --version-info'
coverage; due to the lack of infrastructure needed to run the linker in
the `binutils' test suite and limited justification to implement it add
a new `readelf.exp' script to the `ld' test suite instead, intended to
gather any `readelf' test cases that require the linker to be run.  If
ever we decide to have linker infrastructure added to the `binutils'
test suite, then the script can be moved between the test suites.

	binutils/
	* readelf.c (process_version_sections) <SHT_GNU_verdef>: Limit
	the number of entries processed by the section size.  Don't
	break out of the loop if `ent.vd_next' is 0.

	ld/
	* testsuite/ld-elf/ver_def.d: New test.
	* testsuite/ld-elf/ver_def.ld: New test linker script.
	* testsuite/ld-elf/ver_def.ver: New test version script.
	* testsuite/ld-elf/ver_def.s: New test source.
	* testsuite/ld-elf/readelf.exp: New test script.
2017-02-24 13:48:10 +00:00
Jan Kratochvil a567769b81 DWARF-5: testcase
binutils/
2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* testsuite/binutils-all/dw5.S: New file.
	* testsuite/binutils-all/dw5.W: New file.
	* testsuite/binutils-all/readelf.exp (readelf -wiaoRlL): New test.
2017-02-23 22:58:45 +01:00
Jan Kratochvil 2f6cd5918e DWARF-5: DW_FORM_data16
binutils/
2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf.c (read_and_display_attr_value): Support DW_FORM_data16.
2017-02-23 22:58:20 +01:00
Jan Kratochvil 7a7e1061d4 DWARF-5: Macros
binutils/
2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf.c (display_debug_macro): Support DWARF-5.  Rename
	DW_MACRO_GNU_*.
2017-02-23 22:57:52 +01:00
Jan Kratochvil bc0a77d2b1 DWARF-5: call sites
binutils/
2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf.c (decode_location_expression): Support DW_OP_implicit_pointer,
	DW_OP_const_type, DW_OP_regval_type, DW_OP_deref_type, DW_OP_convert
	and DW_OP_reinterpret.
	(read_and_display_attr_value): Support DW_AT_call_value,
	DW_AT_call_data_value, DW_AT_call_target and
	DW_AT_call_target_clobbered.
2017-02-23 22:57:22 +01:00
Jan Kratochvil 77145576fa DWARF-5 basic functionality
binutils/
2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf.c (fetch_indirect_line_string): New function.
	(abbrev_attr): New field implicit_const.
	(add_abbrev_attr): New parameter implicit_const.
	(process_abbrev_section): Support DW_FORM_implicit_const.
	(decode_location_expression): Support DW_OP_entry_value.
	(read_and_display_attr_value): Add parameter implicit_const.  Support
	DW_FORM_line_strp and DW_FORM_implicit_const.
	(read_and_display_attr): Add parameter implicit_const.
	(process_debug_info): Support line_str and DWARF-5.
	(read_debug_line_header): Support DWARF-5.
	(display_formatted_table): New function.
	(display_debug_lines_raw): New parameter file.  Support DWARF-5.
	(display_debug_lines_decoded): New parameter fileptr.  Support DWARF-5.
	(display_debug_lines): Pass file parameter.
	(display_debug_macro): Update read_and_display_attr_value caller.
	(display_debug_abbrev): Support DW_FORM_implicit_const.
	(display_loclists_list): New function.
	(display_loc_list): Support .debug_loclists.
	(display_debug_ranges_list): New function from display_debug_ranges.
	(display_debug_rnglists_list): New function.
	(display_debug_ranges): Support .debug_rnglists.
	(debug_displays): Add .debug_line_str, .debug_loclists and
	.debug_rnglists.
	* dwarf.h: Include dwarf2.h
	(DWARF2_Internal_LineInfo): Add li_offset_size.
	(DWARF2_Internal_CompUnit): Add cu_unit_type.
	(enum dwarf_section_display_enum): Add line_str.
	* readelf.c (process_section_headers): Add rnglists and loclists.
2017-02-23 22:56:47 +01:00
Jan Kratochvil ef0b5f1c69 DWARF attrs: add delimiter
binutils/
2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf.c (display_block): Add parameter delimiter.
	(decode_location_expression): Update display_block callers.
	(read_and_display_attr_value): Add parameter delimiter.
	(read_and_display_attr, display_debug_macro): Update
	read_and_display_attr_value caller.
2017-02-23 22:54:00 +01:00
Jan Kratochvil 359ca075e7 dwarf.c: Use more dwarf_vma
binutils/
2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf.c (display_loc_list): Use dwarf_vma for offset, base_address
	and off.
	(display_loc_list_dwo): Use dwarf_vma for offset.
	(display_debug_loc): Use dwarf_vma for offset, base_address.
	(struct range_entry, range_entry_compar): Use dwarf_vma for
	ranges_offset.
	(display_debug_ranges): Use dwarf_vma for ranges_offset, offset and
	base_address.
2017-02-23 21:37:31 +01:00
Nick Clifton 60abdbedb2 Add support to readelf for displaying gnu attributes in architectures not known to support them.
* readelf.c (display_tag_value): Use an explicit signed type for
	the tag parameter.
	(display_gnu_attributes): Use an unsigned integer type for
	attribute tags.
	(display_power_gnu_attribute): Likewise.
	(display_s390_gnu_attribute): Likewise.
	(display_sparc_hwcaps): Likewise.
	(display_sparc_hwcaps2): Likewise.
	(display_sparc_gnu_attribute): Likewise.
	(display_mips_gnu_attribute): Likewise.
	(display_tic6x_attribute): Likewise.
	(display_raw_attribute): Likewise.
	(process_attributes): Likewise.
	(process_arm_specific): Delete redundant function.
	(process_power_specific): Likewise.
	(process_s390_specific): Likewise.
	(process_sparc_specific): Likewise.
	(process_tic6x_specific): Likewise.
	(process_msp430x_specific): Likewise.
	(display_public_gnu_attributes): New function.  Displays known
	information about an unknown gnu attribute.
	(display_generic_attribute): New function.  Calls
	display_tag_value for non-nul tags.
	(process_arch_specific): Call process_attributes even for
	architectures not known to specifically support gnu attributes.
2017-02-23 13:45:21 +00:00
Jan Kratochvil 0502a2b49c Display user op byte
binutils/
2017-02-22  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf.c (decode_location_expression): Display also OP.
2017-02-22 20:22:59 +01:00
Maciej W. Rozycki 233f82cfb4 readelf: Restore a lost new line in version information
Fix a commit 74e1a04b97 ("More fixes for reading corrupt ELF files.")
`readelf --version-info' output formatting regression where a dropped
new line caused section header information from the `.gnu.version_d'
version definition section to be printed on the same line as this
section's first entry.

For example with the `mips-linux' target we get:

$ cat ver_def.s
	.data
	.globl	new_foo
	.type	new_foo, %object
new_foo:
	.symver	new_foo, foo@@ver_foo
$ cat ver_def.ver
{ global: *foo*; local: *; };
$ as -o ver_def.o ver_def.s
$ ld -e 0 --export-dynamic --version-script=ver_def.ver -o ver_def ver_def.o
$ readelf -V ver_def

Version symbols section '.gnu.version' contains 4 entries:
 Addr: 000000000000007e  Offset: 0x01007e  Link: 2 (.dynsym)
  000:   0 (*local*)       2 (ver_foo)       1 (*global*)      2 (ver_foo)

Version definition section '.gnu.version_d' contains 2 entries:
  Addr: 0x0000000000000088  Offset: 0x010088  Link: 3 (.dynstr)  000000: Rev: 1  Flags: BASE   Index: 1  Cnt: 1  Name: ver_def
  0x001c: Rev: 1  Flags: none  Index: 2  Cnt: 1  Name: ver_foo
  Version definition past end of section
$

Add the new line then, to get:

$ readelf -V ver_def

Version symbols section '.gnu.version' contains 4 entries:
 Addr: 000000000000007e  Offset: 0x01007e  Link: 2 (.dynsym)
  000:   0 (*local*)       2 (ver_foo)       1 (*global*)      2 (ver_foo)

Version definition section '.gnu.version_d' contains 2 entries:
  Addr: 0x0000000000000088  Offset: 0x010088  Link: 3 (.dynstr)
  000000: Rev: 1  Flags: BASE   Index: 1  Cnt: 1  Name: ver_def
  0x001c: Rev: 1  Flags: none  Index: 2  Cnt: 1  Name: ver_foo
  Version definition past end of section
$

instead.

	binutils/
	* readelf.c (process_version_sections) <SHT_GNU_verdef>: Print a
	new line between the heading and the first version definition
	entry.
2017-02-22 18:16:28 +00:00
Nick Clifton 43a444f9c5 Fix another memory access error in readelf when parsing a corrupt binary.
PR binutils/21156
	* dwarf.c (cu_tu_indexes_read): Move into...
	(load_cu_tu_indexes): ... here.  Change the variable into
	tri-state.  Change the function into boolean, returning
	false if the indicies could not be loaded.
	(find_cu_tu_set): Return NULL if the indicies could not be
	loaded.
2017-02-20 14:40:39 +00:00
Nick Clifton b814a36d34 Fix illegal memory accesses in readelf when parsing a corrupt binary.
PR binutils/21156
	* readelf.c (find_section_in_set): Test for invalid section
	indicies.
2017-02-17 15:59:45 +00:00
Nick Clifton 1b4b80bf37 Add support to readelf for displaying GNU section types.
* readelf.c (get_section_type_name): Add decoding of GNU section
	types.
2017-02-17 15:31:54 +00:00
Pedro Alves 4bc26c6959 bfd: Rename Chunk and S3Forced
The direct references in objcopy kind of look like a hack to me, so
I'm calling these symbols internal too.  Certainly they aren't named
and documented as a public BFD symbol today anyway.

So ... give these bfd-internal symbols with external linkage a _bfd_
prefix to avoid collisions in the global symbol namespace.

While at it, give them names that more closely match the corresponding
option name that toggles them.

Also while at it, fix a few related comment typos.

gdb/ChangeLog:
2017-02-17  Pedro Alves  <palves@redhat.com>

	* srec.c (Chunk): Rename to ...
	(_bfd_srec_len): ... this.
	(S3Forced): Rename to ...
	(_bfd_srec_forceS3): ... this.
	* objcopy.c: Adjust all references.
2017-02-17 01:26:12 +00:00
Nick Clifton 7c723eecec Move Eric Christopher to Past Maintainers list.
* MAINTAINERS: (MIPS, MN10300): Move Eric Christopher to Past
	Maintainers section.
2017-02-15 09:42:38 +00:00
Nick Clifton bc303e5d6c Fix invalid memory access displayiing contents of sections.
PR binutils/21159
	* readelf.c (dump_section_as_strings): Reset the start address if
	no decompression is perfromed.
	(dump_section_as_bytes): Likewise.
2017-02-14 15:10:34 +00:00
Nick Clifton 92134dc19b Fix an illegal memory access parsing corrupt STABD debug information.
PR binutils/21158
	* rddbg.c (read_symbol_stabs_debugging_info): Check for a null or
	empty symbol name.
2017-02-14 14:17:09 +00:00
Nick Clifton a2dea0b20b Fix handling of corrupt STABS enum type strings.
PR binutils/21157
	* stabs.c (parse_stab_enum_type): Check for corrupt NAME:VALUE
	pairs.
	(parse_number): Exit early if passed an empty string.
2017-02-14 14:07:29 +00:00
Nick Clifton b32e566ba6 Fix illegal memory access problems with readelf processing corrupt RL78 binaries.
PR binutils/21155
	* readelf.c (IN_RANGE): New macro.  Tests for an address + offset
	being within a given range.
	(target_specific_reloc_handling): Use macro to test for underflow
	as well as overflow of reloc offset.
2017-02-14 13:24:09 +00:00
Nick Clifton c12214021d Fix illegal memory access bug in nm when run on a corrupt binary.
PR binutils/21150
	* nm.c (file_symbol): Add test of string length before testing
	string characters.
2017-02-13 17:23:10 +00:00
Nick Clifton 1835f746a7 Extend previous patch to cover uncompress_section_contents returning FALSE to other callers.
PR binutils/21135
	(dump_section_as_bytes, load_specific_debug_section): Likewise.
2017-02-13 15:19:48 +00:00
Nick Clifton f055032e4e Fix invalid read of section contents whilst processing a corrupt binary.
PR binutils/21135
	* readelf.c (dump_section_as_bytes): Handle the case where
	uncompress_section_contents returns false.
2017-02-13 15:04:37 +00:00
Nick Clifton ebdf1ebfa5 Fix invalid memory access attempting to read the compression header of a too-small compressed section.
PR binutils/21149
	* readelf.c (get_compression_header): Add size parameter.  Check
	size against sizeof compression header before attempting to
	extract the header.
	(process_section_headers): Pass size to get_compression_header.
	(dump_section_as_strings): Likewise.
	(dump_section_as_bytes): Likewise.
	(load_specific_debug_section): Likewise.
2017-02-13 14:52:48 +00:00
Nick Clifton 4aeb00ad3c Fix check for buffer overflow when processing version information.
PR binutils/21148
	* readelf.c (process_version_sections): Include size of auxillary
	version information when checking for buffer overflow.
2017-02-13 14:35:24 +00:00
Nick Clifton 0ee3043f58 Fix access violation when reporting sections that could not be dumped.
PR binutils/21147
	* readelf.c (process_section_contents): Fix off by one error
	reporting un-dumped sections.
2017-02-13 14:17:07 +00:00
Nick Clifton f84ce13b67 Fix read-after-free error in readelf when processing multiple, relocated sections in an MSP430 binary.
PR binutils/21139
	* readelf.c (target_specific_reloc_handling): Add num_syms
	parameter.  Check for symbol table overflow before accessing
	symbol value.  If reloc pointer is NULL, discard all saved state.
	(apply_relocations): Pass num_syms to target_specific_reloc_handling.
	Call target_specific_reloc_handling with a NULL reloc pointer
	after processing all of the relocs.
2017-02-13 14:03:22 +00:00
Nick Clifton 03f7786e2f Fix readelf writing to illegal addresses whilst processing corrupt input files containing symbol-difference relocations.
PR binutils/21137
	* readelf.c (target_specific_reloc_handling): Add end parameter.
	Check for buffer overflow before writing relocated values.
	(apply_relocations): Pass end to target_specific_reloc_handling.
2017-02-13 13:08:32 +00:00
Dilyan Palauzov 387dd77738 Update description of the -plugin option used by the linker, ar and nm.
PR 20343
ld	* ld.texinfo (Options): Extend documentation of the --plugin
	option.  Include a description of where the plugins should be
	located.

binutils* doc/binutils.texi (ar): Extend documentation of the --plugin
	option.  Include a description of where the plugins should be
	located.
	(nm): Likewise.
2017-01-27 13:20:24 +00:00
Nick Clifton c49f9d0fda Fix typo in MAINTAINERS file 2017-01-23 16:28:46 +00:00
Nick Clifton 71d01c691e Remove Mei Ligang as SCORE maintainer 2017-01-23 16:20:57 +00:00
Nick Clifton cf581a9b94 Add Bernd Schmidt to Past Maintainers list 2017-01-23 16:16:55 +00:00
Bernd Schmidt 715e99a498 * MAINTAINERS (BFIN): Remove myself as Blackfin maintainer. 2017-01-23 15:00:23 +01:00
Andrew Burgess 1737c64030 objdump: Better objdump section headers in wide mode
When displaying the section headers table using objdump (-h), the column
containing the section header name is currently fixed at 13 characters.
A section name that is longer than 13 characters will overflow the
column causing the table to become miss-aligned.

In this commit I change the behaviour so that _in wide mode_ (-w -h) the
section name column is dynamically resized to fit the longest section
name we plan to display.  In wide mode the column still retains a
minimum width of 13 characters.

In non-wide more the behaviour is completely unchanged.

While I was changing the dump_headers function I have unified the two
printf lines that handled the different address widths into a single
printf, the address width is now passed into printf using the '*' field
width format character.

binutils/ChangeLog:

	* objdump.c (dump_section_header): Extract max section name length
	from data parameter, use this when formatting output.
	(find_longest_section_name): New function.
	(dump_headers): Calculate longest section name when in wide mode,
	reformat to unify printing of header line.

ld/ChangeLog:

	* testsuite/ld-elf/eh-frame-hdr.d: Update expected results.
2017-01-20 09:05:41 +00:00
Bernhard Rosenkranzer 2cedb9ebf8 Add support for processing lex source files with flex v 2.6.3
PR 21059
binutils* arlex.l: Support processing with flex 2.6.3.
	* deflex.l: Likewise.

gas	* config/bfin-lex.l: Support processing with flex 2.6.3.
	* itbl-lex.l: Likewise.
2017-01-18 13:38:27 +00:00
Dmitry Timoshkov 6bb21700ab Stop the (optional) dialong control data from being aligned when parsing/writing windows resource files.
binutils* resbin.c: Optional dialog control data immediately follow
	the control description without alignment.
	* testsuite/binutils-all/windres/controldata.rc: New test.
	source.
	* testsuite/binutils-all/windres/controldata.rsd: New test.
2017-01-18 11:40:06 +00:00
Nick Clifton 2425a30e40 Add support for locating separate debug info files via the build-id method.
PR binutils/20876
bfd	* opncls.c (find_separate_debug_file): Add include_dirs
	parameter.  Only include the directory part of the bfd's filename
	in search paths if include_dirs is true.  Add a couple of extra
	locations for looking for debug files.
	( bfd_follow_gnu_debuglink): Update invocation of
	find_separate_debug_file.
	(bfd_follow_gnu_debugaltlink): Likewise.
	(get_build_id): New function: Finds the build-id of the given bfd.
	(get_build_id_name): New function: Computes the name of the
	separate debug info file for a bfd, based upon its build-id.
	(check_build_id_file): New function: Checks to see if a separate
	debug info file exists at the given location, and that its
	build-id matches that of the original bfd.
	(bfd_follow_build_id_debuglink): New function: Finds a separate
	debug info file for a given bfd by using the build-id method.
	* dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
	method of locating a separate debug info file before using the
	debuglink method.
	* bfd-in2.h: Regenerate.

binutils * NEWS: Mention the new feature.
	* testsuite/binutils-all/objdump.exp (test_build_id_debuglink):
	New proc to test the location of separate debug info files using
	the build-id method.
2017-01-12 16:56:54 +00:00
Nick Clifton b972a0d61a Fix compile time warning about pointer comparison.
PR 21034
	* stabs.c (parse_stab_members): Fix thinko checking for g++
	version 1 stabs information.
2017-01-10 11:45:12 +00:00
Nick Clifton 07e8e62387 Updated Swedish translations for GAS and LD 2017-01-10 11:28:36 +00:00
Nick Clifton cd6581da62 Speed up objdump when displaying disassembly mixed with line number and source code information.
bfd	* dwarf2.c (lookup_address_in_function_table): Return early if
	there are no functions in the given comp unit, or if the high
	address of the last function in the comp unit is less than the
	desired address.

binutils * objdump.c (display_file): Add new parameter 'last_file'.  If
	last_file is true, do not call bfd_close at the end of the
	function.
	(main): Set the value of the last_file parameter when calling
	display_file.
2017-01-09 16:49:48 +00:00
Alan Modra 4d74727a4a .rela.dyn comment fix and add missing ChangeLog entry
ChangeLog entry missed from commit dd90581873.

	* readelf.c (process_section_headers): Correct .rel.dyn/.rela.dyn
	comment.
2017-01-09 12:10:55 +10:30
Nick Clifton fd13a84bb0 Retire Paul Brook as an ARM maintainer.
* MAINTAINERS: Move Paul Brook to the Past Maintainers section.
2017-01-06 12:24:54 +00:00
Dilan Palauzov b055631694 Use noyywrap option in lex files.
ld	PR 20958
	* ldlex.l (option): Add noyywrap
	(yywrap): Delete.
	* ldlex.h (yywrap): Delete prototype.

binutils
	PR 20958
	* syslex.l (option): Add noyywrap
	(yywrap): Delete.
2017-01-04 16:05:22 +00:00