Commit Graph

84700 Commits

Author SHA1 Message Date
H.J. Lu 1b7868733d Remove trailing spaces in bfd 2015-08-12 04:32:43 -07:00
Nick Clifton aa91aff6af Update Swedish translation in gprof.
* po/sv.po: Updated Swedish translation.
2015-08-12 11:53:53 +01:00
Luis Machado 244558af86 [regression] Do not read from catchpoint/watchpoint locations' addresses when checking for a permanent breakpoint
While running bare-metal tests with GDB i noticed some failures in
gdb.base/break.exp, related to the use of the catch commands.

It turns out GDB tries to access memory address 0x0 whenever one tries
to insert a catchpoint, which should obviously not happen.

This was introduced with the changes for permanent breakpoints. In special,
bp_loc_is_permanent tries to check if there is a breakpoint inserted at
the same address as the current breakpoint's location's address. In the
case of catchpoints, this is 0x0.

(top-gdb) catch fork
Sending packet: $m0,1#fa...Packet received: E01
Catchpoint 4 (fork)

(top-gdb) catch vfork
Sending packet: $m0,1#fa...Packet received: E01
Catchpoint 5 (vfork)

It is not obvious to detect because this fails silently for Linux. For our
bare-metal testing, though, this fails with a clear error message from the
target about not being able to read such address.

The attached patch addresses this by bailing out of bp_loc_is_permanent (...)
if the location address is not meaningful. I also took the opportunity to
update the comment for breakpoint_address_is_meaningful, which mentioned
breakpoint addresses as opposed to their locations' addresses.

gdb/ChangeLog:

2015-08-11  Luis Machado  <lgustavo@codesourcery.com>

	* breakpoint.c (bp_loc_is_permanent): Return 0 when breakpoint
	location address is not meaningful.
	(breakpoint_address_is_meaningful): Update comment.
2015-08-12 05:36:09 -03:00
H.J. Lu 0eace2105d Properly skip IFUNC relocations in debug sections
Use "continue" instead of "break" to skip IFUNC relocations in debug
sections.

	* elf32-i386.c (elf_i386_relocate_section): Properly skip IFUNC
	relocations in debug sections.
	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2015-08-11 19:04:38 -07:00
Thomas Preud'homme f63d6d9650 [AArch64] Rename relocs-257-symbolic-func ld test to relocs-1027-symbolic-func.
2015-08-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>

ld/testsuite/
    * ld-aarch64/aarch64-elf.exp: Rename relocs-257-symbolic-func to
    relocs-1027-symbolic-func.
    * ld-aarch64/relocs-257-symbolic-func.d: Rename to ...
    * ld-aarch64/relocs-1027-symbolic-func.d: ... this.
    * ld-aarch64/relocs-257-symbolic-func.s: Rename to ...
    * ld-aarch64/relocs-1027-symbolic-func.s: ... this.
2015-08-12 09:34:13 +08:00
Keith Seitz 629500fae6 Explicit locations: documentation updates
This patch adds documentation for explicit locations to both the
User Manual and gdb's online help system.

gdb/ChangeLog:

	* NEWS: Mention explicit locations.
	* breakpoint.c [LOCATION_HELP_STRING]: New macro.
	[BREAK_ARGS_HELP]: Use LOCATION_HELP_STRING.
	(_initialize_breakpoint): Update documentation for
	"clear", "break", "trace", "strace", "ftrace", and "dprintf".

gdb/doc/ChangeLog:

	* gdb.texinfo (Thread-Specific Breakpoints, Printing Source Lines):
	Use "location(s)"instead of "linespec(s)".
	(Specifying a Location): Rewrite.
	Add subsections describing linespec, address, and explicit locations.
	Add node/menu for each subsection.
	(Source and Machine Code, C Preprocessor Macros)
	(Create and Delete Trace points)
	(Extensions for Ada Tasks): Use "location(s)" instead of "linespec(s)".
	(Continuing at a Different Address): Remove "linespec" examples.
	Add reference to "Specify a Location"
	(The -break-insert Command): Rewrite.  Add anchor.
	Add reference to appropriate manual section discussing locations.
	(The -dprintf-insert Command): Refer to -break-insert for
	specification of 'location'.

gdb/testsuite/ChangeLog:

	* gdb.base/help.exp: Update help_breakpoint_text.
2015-08-11 17:09:36 -07:00
Keith Seitz eb8c4e2e66 Explicit locations: MI support for explicit locations
This patch adds support for explicit locations to MI's -break-insert
command. The new options, documented in the User Manual, are
--source, --line, --function, and --label.

gdb/ChangeLog:

	* mi/mi-cmd-break.c (mi_cmd_break_insert_1): Add support for
	explicit locations, options "--source", "--function",
	"--label", and "--line".

gdb/testsuite/ChangeLog:

	* gdb.mi/mi-break.exp (test_explicit_breakpoints): New proc.
	(at toplevel): Call test_explicit_breakpoints.
	* gdb.mi/mi-dprintf.exp: Add tests for explicit dprintf
	breakpoints.
	* lib/mi-support.exp (mi_make_breakpoint): Add support for
	breakpoint conditions, "-cond".
2015-08-11 17:09:36 -07:00
Keith Seitz 87f0e72047 Explicit locations: add UI features for CLI
This patch exposes explicit locations to the CLI user.  This enables
users to "explicitly" specify attributes of the breakpoint location
to avoid any ambiguity that might otherwise exist with linespecs.

The general syntax of explicit locations is:
-source SOURCE_FILENAME -line {+-}LINE -function FUNCTION_NAME
-label LABEL_NAME

Option names may be abbreviated, e.g., "-s SOURCE_FILENAME -li 3" and users
may use the completer with either options or values.

gdb/ChangeLog:

	* completer.c: Include location.h.
	(enum match_type): New enum.
	(location_completer): Rename to ...
	(linespec_completer): ... this.
	(collect_explicit_location_matches, backup_text_ptr)
	(explicit_location_completer): New functions.
	(location_completer): "New" function; handle linespec
	and explicit location completions.
	(complete_line_internal): Remove all location completer-specific
	handling.
	* linespec.c (linespec_lexer_lex_keyword, is_ada_operator)
	(find_toplevel_char): Export.
	(linespec_parse_line_offset): Export.
	Issue error if STRING is not numerical.
	(gdb_get_linespec_parser_quote_characters): New function.
	* linespec.h (linespec_parse_line_offset): Declare.
	(get_gdb_linespec_parser_quote_characters): Declare.
	(is_ada_operator): Declare.
	(find_toplevel_char): Declare.
	(linespec_lexer_lex_keyword): Declare.
	* location.c (explicit_to_event_location): New function.
	(explicit_location_lex_one): New function.
	(string_to_explicit_location): New function.
	(string_to_event_location): Handle explicit locations.
	* location.h (explicit_to_event_location): Declare.
	(string_to_explicit_location): Declare.

gdb/testsuite/ChangeLog:

	* gdb.linespec/3explicit.c: New file.
	* gdb.linespec/cpexplicit.cc: New file.
	* gdb.linespec/cpexplicit.exp: New file.
	* gdb.linespec/explicit.c: New file.
	* gdb.linespec/explicit.exp: New file.
	* gdb.linespec/explicit2.c: New file.
	* gdb.linespec/ls-errs.exp: Add explicit location tests.
	* lib/gdb.exp (capture_command_output): Regexp-escape `command'
	before using in the matching pattern.
	Clarify that `prefix' is a regular expression.
2015-08-11 17:09:36 -07:00
Keith Seitz 00e52e5376 Explicit locations: introduce explicit locations
This patch add support for explicit locations and switches many linespec
locations to this new location type.  This patch also converts all
linespec locations entered by the user to an explicit representation
internally (thus bypassing the linespec parser when resetting the
breakpoint).

This patch does not introduce any user-visible changes.


gdb/ChangeLog:

	* break-catch-throw.c (re_set_exception_catchpoint): Convert
	linespec into explicit location.
	* breakpoint.c (create_overlay_breakpoint)
	(create_longjmp_master_breakpoint)
	(create_std_terminate_master_breakpoint)
	(create_exception_master_breakpoint): Convert linespec into explicit
	location.
	(update_static_tracepoint): Convert linespec into explicit location.
	* linespec.c (enum offset_relative_sign, struct line_offset): Move
	location.h.
	(struct linespec) <expression, expr_pc, source_filename>
	<function_name, label_name, line_offset>: Replace with ...
	<explicit>: ... this.
	<is_linespec>: New member.
	(PARSER_EXPLICIT): New accessor macro.
	(undefined_label_error): New function.
	(source_file_not_found_error): New function.
	(linespec_parse_basic): The parser result is now an explicit location.
	Use PARSER_EXPLICIT to access it.
	Use undefined_label_error.
	(canonicalize_linespec): Convert canonical linespec into explicit
	location.
	Move string representation of location to explicit_location_to_linespec
	and use it and explicit_location_to_string to save string
	representations of the canonical location.
	(create_sals_line_offset, convert_linespec_to_sals): `ls' contains an
	explicit location.  Update all references.
	(convert_explicit_location_to_sals): New function.
	(parse_linespec): Use PARSER_EXPLICIT to access the parser
	result's explicit location.
	(linespec_state_constructor): Initialize is_linespec.
	Use PARSER_EXPLICIT.
	(linespec_parser_delete): Use PARSER_EXPLICIT to access the parser's
	result.
	(event_location_to_sals): For linespec locations, set is_linespec.
	Handle explicit locations.
	(decode_objc): 'ls' contains an explicit location now. Update all
	references.
	(symtabs_from_filename): Use source_file_not_found_error.
	* location.c (struct event_location.u) <explicit>: New member.
	(initialize_explicit_location): New function.
	(initialize_event_location): Initialize explicit locations.
	(new_explicit_location, get_explicit_location)
	(get_explicit_location_const): New functions.
	(explicit_to_string_internal): New function; most of contents moved
	from canonicalize_linespec.
	(explicit_location_to_string): New function.
	(explicit_location_to_linespec): New function.
	(copy_event_location, delete_event_location)
	(event_location_to_string_const, event_location_empty_p): Handle
	explicit locations.
	* location.h (enum offset_relative_sign, struct line_offset): Move
	here from linespec.h.
	(enum event_location_type): Add EXPLICIT_LOCATION.
	(struct explicit_location): New structure.
	(explicit_location_to_string): Declare.
	(explicit_location_to_linespec): Declare.
	(new_explicit_location, get_explicit_locationp
	(get_explicit_location_const, initialize_explicit_location): Declare.
2015-08-11 17:09:35 -07:00
Keith Seitz 5b56227bdc Explicit locations: introduce probe locations
This patch adds support for probe locations and converts existing
probe linespec locations to the new location type.

gdb/ChangeLog:

	* break-catch-throw.c (re_set_exception_catchpoint): Convert
	linespec for stap probe to probe location.
	* breakpoint.c (create_longjmp_master_breakpoint)
	(create_exception_master_breakpoint): Likewise.
	(break_command_1): Remove local variable `arg_cp'.
	Check location type to set appropriate breakpoint ops methods.
	(trace_command): Likewise.
	* linespec.c (event_location_to_sals): Assert on probe locations.
	* location.c (EL_PROBE): Add macro definition.
	(new_probe_location, get_probe_location): New functions.
	(copy_event_location, delete_event_location, event_location_to_string)
	(string_to_event_location, event_location_empty_p): Handle probe
	locations.
	* location.h (enum event_location_type): Add PROBE_LOCATION.
	(new_probe_location, get_probe_location): Declare.
	* probe.c (parse_probes): Assert that LOCATION is a probe location.
	Convert linespec into probe location.
2015-08-11 17:09:35 -07:00
Keith Seitz a06efdd6ef Explicit locations: introduce address locations
This patch adds support for address locations, of the form "*ADDR".
[Support for address linespecs has been removed/replaced by this "new"
location type.] This patch also converts any existing address locations
from its previous linespec type.

gdb/ChangeLog:

	* breakpoint.c (create_thread_event_breakpoint, init_breakpoint_sal):
	Convert linespec to address location.
	* linespec.c (canonicalize_linespec): Do not handle address
	locations here.
	(convert_address_location_to_sals): New function; contents moved
	from ...
	(convert_linespc_to_sals): ... here.
	(parse_linespec): Remove address locations from linespec grammar.
	Remove handling of address locations.
	(linespec_lex_to_end): Remove handling of address linespecs.
	(event_location_to_sals): Handle ADDRESS_LOCATION.
	(linespec_expression_to_pc): Export.
	* linespec.h (linespec_expression_to_pc): Add declaration.
	* location.c (struct event_location.u) <address>: New member.
	(new_address_location, get_address_location): New functions.
	(copy_event_location, delete_event_location, event_location_to_string)
	(string_to_event_location, event_location_empty_p): Handle address
	locations.
	* location.h (enum event_location_type): Add ADDRESS_LOCATION.
	(new_address_location, get_address_location): Declare.
	* python/py-finishbreakpoint.c (bpfinishpy_init): Convert linespec
	to address location.
	* spu-tdep.c (spu_catch_start): Likewise.
2015-08-11 17:09:35 -07:00
Keith Seitz f00aae0f7b Explicit locations: use new location API
This patch converts the code base to use the new struct event_location
API being introduced. This patch preserves the current functionality and
adds no new features.

The "big picture" API usage introduced by this patch may be illustrated
with a simple exmaple. Where previously developers would write:

void
my_command (char *arg, int from_tty)
{
   create_breakpoint (..., arg, ...);
   ...
}

one now uses:

void
my_command (char *arg, int from_tty)
{
   struct event_locaiton *location;
   struct cleanup *back_to;

   location = string_to_event_locaiton (&arg, ...);
   back_to = make_cleanup_delete_event_location (location);
   create_breakpoint (..., location, ...);
   do_cleanups (back_to);
}

Linespec-decoding functions (now called location-decoding) such as
decode_line_full no longer skip argument pointers over processed input.
That functionality has been moved into string_to_event_location as
demonstrated above.

gdb/ChangeLog

	* ax-gdb.c: Include location.h.
	(agent_command_1) Use linespec location instead of address
	string.
	* break-catch-throw.c: Include location.h.
	(re_set_exception_catchpoint): Use linespec locations instead
	of address strings.
	* breakpoint.c: Include location.h.
	(create_overlay_event_breakpoint, create_longjmp_master_breakpoint)
	(create_std_terminate_master_breakpoint)
	(create_exception_master_breakpoint, update_breakpoints_after_exec):
	Use linespec location instead of address string.
	(print_breakpoint_location):  Use locations and
	event_location_to_string.
	Print extra_string for pending locations for non-MI streams.
	(print_one_breakpoint_location): Use locations and
	event_location_to_string.
	(init_raw_breakpoint_without_location): Initialize b->location.
	(create_thread_event_breakpoint): Use linespec location instead of
	address string.
	(init_breakpoint_sal): Likewise.
	Only save extra_string if it is non-NULL and not the empty string.
	Use event_location_to_string instead of `addr_string'.
	Constify `p' and `endp'.
	Use skip_spaces_const/skip_space_const instead of non-const versions.
	Copy the location into the breakpoint.
	If LOCATION is NULL, save the breakpoint address as a linespec location
	instead of an address string.
	(create_breakpoint_sal): Change `addr_string' parameter to a struct
	event_location. All uses updated.
	(create_breakpoints_sal): Likewise for local variable `addr_string'.
	(parse_breakpoint_sals): Use locations instead of address strings.
	Remove check for empty linespec with conditional.
	Refactor.
	(decode_static_tracepoint_spec): Make argument const and update
	function.
	(create_breakpoint): Change `arg' to a struct event_location and
	rename.
	Remove `copy_arg' and `addr_start'.
	If EXTRA_STRING is empty, set it to NULL.
	Don't populate `canonical' for pending breakpoints.
	Pass `extra_string' to find_condition_and_thread.
	Clear `extra_string' if `rest' was NULL.
	Do not error with "garbage after location" if setting a dprintf
	breakpoint.
	Copy the location into the breakpoint instead of an address string.
	(break_command_1): Use string_to_event_location and pass this to
	create_breakpoint instead of an address string.
	Check against `arg_cp' for a probe linespec.
	(dprintf_command): Use string_to_event_location and pass this to
	create_breakpoint instead of an address string.
	Throw an exception if no format string was specified.
	(print_recreate_ranged_breakpoint): Use event_location_to_string
	instead of address strings.
	(break_range_command, until_break_command)
	(init_ada_exception_breakpoint): Use locations instead
	of address strings.
	(say_where): Print out extra_string for pending locations.
	(base_breakpoint_dtor): Delete `location' and `location_range_end' of
	the breakpoint.
	(base_breakpoint_create_sals_from_location): Use struct event_location
	instead of address string.
	Remove `addr_start' and `copy_arg' parameters.
	(base_breakpoint_decode_location): Use struct event_location instead of
	address string.
	(bkpt_re_set): Use locations instead of address strings.
	Use event_location_empty_p to check for unset location.
	(bkpt_print_recreate): Use event_location_to_string instead of
	an address string.
	Print out extra_string for pending locations.
	(bkpt_create_sals_from_location, bkpt_decode_location)
 	(bkpt_probe_create_sals_from_location): Use struct event_location
	instead of address string.
	(bkpt_probe_decode_location): Use struct event_location instead of
	address string.
	(tracepoint_print_recreate): Use event_location_to_string to
	recreate the tracepoint.
	(tracepoint_create_sals_from_location, tracepoint_decode_location)
	(tracepoint_probe_create_sals_from_location)
	(tracepoint_probe_decode_location): Use struct event_location
	instead of address string.
	(dprintf_print_recreate): Use event_location_to_string to recreate
	the dprintf.
	(dprintf_re_set): Remove check for valid/missing format string.
	(strace_marker_create_sals_from_location)
	(strace_marker_create_breakpoints_sal, strace_marker_decode_location)
	(update_static_tracepoint): Use struct event_location instead of
	address string.
	(location_to_sals): Likewise.
	Pass `extra_string' to find_condition_and_thread.
	For newly resolved pending breakpoint locations, clear the location's
	string representation.
	Assert that the breakpoint's condition string is NULL when
	condition_not_parsed.
	(breakpoint_re_set_default, create_sals_from_location_default)
	(decode_location_default, trace_command, ftrace_command)
	(strace_command, create_tracepoint_from_upload): Use locations
	instead of address strings.
	* breakpoint.h (struct breakpoint_ops) <create_sals_from_location>:
	Use struct event_location instead of address string.
	Update all uses.
	<decode_location>: Likewise.
	(struct breakpoint) <addr_string>: Change to struct event_location
	and rename `location'.
	<addr_string_range_end>: Change to struct event_location and rename
	`location_range_end'.
	(create_breakpoint): Use struct event_location instead of address
	string.
	* cli/cli-cmds.c: Include location.h.
	(edit_command, list_command): Use locations instead of address strings.
	* elfread.c: Include location.h.
	(elf_gnu_ifunc_resolver_return_stop): Use event_location_to_string.
	* guile/scm-breakpoint.c: Include location.h.
	(bpscm_print_breakpoint_smob): Use event_location_to_string.
	(gdbscm_register_breakpoint): Use locations instead of address
	strings.
	* linespec.c: Include location.h.
	(struct ls_parser) <stream>: Change to const char *.
	(PARSER_STREAM): Update.
	(lionespec_lexer_lex_keyword): According to find_condition_and_thread,
	keywords must be followed by whitespace.
	(canonicalize_linespec): Save a linespec location into `canonical'.
	Save a canonical linespec into `canonical'.
	(parse_linespec): Change `argptr' to const char * and rename `arg'.
	All uses updated.
	Update function description.
	(linespec_parser_new): Initialize `parser'.
	Update initialization of  parsing stream.
	(event_location_to_sals): New function.
	(decode_line_full): Change `argptr' to a struct event_location and
	rename it `location'.
	Use locations instead of address strings.
	Call event_location_to_sals instead of parse_linespec.
	(decode_line_1): Likewise.
	(decode_line_with_current_source, decode_line_with_last_displayed)
	Use locations instead of address strings.
	(decode_objc): Likewise.
	Change `argptr' to const char * and rename `arg'.
	(destroy_linespec_result): Delete the linespec result's location
	instead of freeing the address string.
	* linespec.h (struct linespec_result) <addr_string>: Change to
	struct event_location and rename to ...
	<location>: ... this.
	(decode_line_1, decode_line_full): Change `argptr' to struct
	event_location.  All callers updated.
	* mi/mi-cmd-break.c: Include language.h, location.h, and linespec.h.
	(mi_cmd_break_insert_1): Use locations instead of address strings.
	Throw an error if there was "garbage" at the end of the specified
	linespec.
	* probe.c: Include location.h.
	(parse_probes): Change `argptr' to struct event_location.
	Use event locations instead of address strings.
	* probe.h (parse_probes): Change `argptr' to struct event_location.
	* python/py-breakpoint.c: Include location.h.
	(bppy_get_location): Constify local variable `str'.
	Use event_location_to_string.
	(bppy_init): Use locations instead of address strings.
	* python/py-finishbreakpoint.c: Include location.h.
	(bpfinishpy_init): Remove local variable `addr_str'.
	Use locations instead of address strings.
	* python/python.c: Include location.h.
	(gdbpy_decode_line): Use locations instead of address strings.
	* remote.c: Include location.h.
	(remote_download_tracepoint): Use locations instead of address
	strings.
	* spu-tdep.c: Include location.h.
	(spu_catch_start): Remove local variable `buf'.
	Use locations instead of address strings.
	* tracepoint.c: Include location.h.
	(scope_info): Use locations instead of address strings.
	(encode_source_string): Constify parameter `src'.
	* tracepoint.h (encode_source_string): Likewise.

gdb/testsuite/ChangeLog

	* gdb.base/dprintf-pending.exp: Update dprintf "without format"
	test.
	Add tests for missing ",FMT" and ",".
2015-08-11 17:09:35 -07:00
Keith Seitz c7c1b3e998 Explicit locations: introduce new struct event_location-based API
This patch introduces the new breakpoint/"linespec" API based on
a new struct event_location.  This API currently only supports
traditional linespecs, maintaining the status quo of the code base.
Future patches will add additional functionality for other location
types such as address locations.

gdb/ChangeLog:

	* Makefile.in (SFILES): Add location.c.
	(HFILES_NO_SRCDIR): Add location.h.
	(COMMON_OBS): Add location.o.
	* linespec.c (linespec_lex_to_end): New function.
	* linespec.h (linespec_lex_to_end): Declare.
	* location.c: New file.
	* location.h: New file.
2015-08-11 17:09:35 -07:00
Keith Seitz 5f700d83f7 Explicit locations: rename "address string"/"addr_string" to "location"
This patch renames all occurrances of "addr_string" and "address
string" in the breakpoint/linespec APIs.  This will emphasize the
change from address strings used in setting breakpoints (et al) to the
new locations-based API introduced in subsequent patches.

gdb/ChangeLog:

	* breakpoint.h (struct breakpoint_ops) <create_sals_from_address>:
	Renamed to create_sals_from_location.
	<decode_linespec>: Renamed to decode_location.
	Update all callers.
	* breakpoint.c (create_sals_from_address_default): Renamed to ...
	(create_sals_from_location_default): ... this.
	(addr_string_to_sals): Renamed to ...
	(location_to_sals): ... this.
	(decode_linespec_default): Renamed to ...
	(decode_location_default): ... this.
	(base_breakpoint_create_sals_from_address): Renamed to ...
	(base_breakpoint_create_sals_from_location): ... this.
	(bkpt_create_sals_from_address): Renamed to ...
	(bkpt_create_sals_from_location): ... this.
	(bkpt_decode_linespec): Renamed to ...
	(bkpt_decode_location): ... this.
	(bkpt_probe_create_sals_from_address): Renamed to ...
	(bkpt_probe_create_sals_from_location): ... this.
	(tracepoint_create_sals_from_address): Renamed to ...
	(tracepoint_create_sals_from_location): ... this.
	(tracepoint_decode_linespec): Renamed to ...
	(tracepoint_decode_location): ... this.
	(tracepoint_probe_create_sals_from_address): Renamed to ...
	(tracepoint_probe_create_sals_from_location): ... this.
	(tracepoint_probe_decode_linespec): Renamed to ...
	(tracepoint_probe_decode_location): ... this.
	(strace_marker_create_sals_from_address): Renamed to ...
	(strace_marker_create_sals_from_location): ... this.
	(decode_linespec_default): Renamed to ...
	(decode_location_default): ... this.
2015-08-11 17:09:35 -07:00
GDB Administrator a12a06d74a Automatic date update in version.in 2015-08-12 00:00:07 +00:00
Jiong Wang c674f5cd3f [AArch64] Improve BFD overflow warning message for -fpic
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Improve warning
  message for R_AARCH64_LD64_GOTPAGE_LO15/R_AARCH64_LD32_GOTPAGE_LO14.
2015-08-11 22:12:41 +01:00
Jiong Wang b261b4db94 [AArch64] Commit missing testcases 2015-08-11 22:12:08 +01:00
Jiong Wang 9331eea1f8 [AArch64]Speed up linking speed by skipping unncessary TLS reloc type check
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
   * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): New.
  (aarch64_can_relax_tls): Use the new IS_AARCH64_TLS_RELAX_RELOC.
2015-08-11 22:05:39 +01:00
Jiong Wang f678ded748 [AArch64] Long branch veneer support far symbol defined by --defsym
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * bfd/elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec".
  Loose the check for symbol from ABS section.
  (elfNN_aarch64_size_stubs): Pass sym_sec.

ld/testsuite/
  * ld-aarch64/farcall-b-defsym.s: New test.
  * ld-aarch64/farcall-bl-defsym.s: Likewise.
  * ld-aarch64/farcall-b-defsym.d: New expectation.
  * ld-aarch64/farcall-bl-defsym.d: Likewise.
2015-08-11 21:55:52 +01:00
Jiong Wang 07f9ddfeba [AArch64] PR18668, repair long branch veneer for plt stub
2015-08-11  Jiong Wang  <jiong.wang@arm.com>
bfd/
   PR ld/18668
   * elfnn-aarch64.c (aarch64_type_of_stub): Update destination for
   calls go through plt stub.
   (elfNN_aarch64_final_link_relocate): Adjust code logic for CALL26,
   JUMP26 relocation to support inserting veneer for call to plt stub.

ld/testsuite/
   * ld-aarch64/farcall-b-gsym.s: New test.
   * ld-aarch64/farcall-b-plt.s: Likewise.
   * ld-aarch64/farcall-bl-plt.s: Likewise.
   * ld-aarch64/farcall-b-gsym.d: New expect file.
   * ld-aarch64/farcall-b-plt.d: Likewise.
   * ld-aarch64/farcall-bl-plt.d: Likewise.
2015-08-11 21:44:31 +01:00
Jiong Wang 40fbed8481 [AArch64][8/8] LD support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
  BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
  (aarch64_reloc_got_type): Likewise.
  (elfNN_aarch64_final_link_relocate): Likewise.
  (elfNN_aarch64_relocate_section): Likewise.
  * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
  (_bfd_aarch64_elf_resolve_relocation): Likewise.

ld/testsuite/
  * ld-aarch64/emit-relocs-529.s: New testcase.
  * ld-aarch64/emit-relocs-529-overflow.s: Likewise.
  * ld-aarch64/emit-relocs-86.s: Likewise.
  * ld-aarch64/emit-relocs-86-overflow.s: Likewise.
  * ld-aarch64/emit-relocs-529.d: New expectation file.
  * ld-aarch64/emit-relocs-529-overflow.d: Likewise.
  * ld-aarch64/emit-relocs-86.d: Likewise.
  * ld-aarch64/emit-relocs-86-overflow.d: Likewise.
  * ld-aarch64/aarch64-elf.exp: Run new testcases.
2015-08-11 21:26:41 +01:00
Jiong Wang 70151fb54a [AArch64][7/8] GAS support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

include/elf/
  * aarch64.h (R_AARCH64_P32_TLSLD_ADD_DTPREL_LO12): Define.

bfd/
  * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers
  "dtprel_lo12".
  (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
  (aarch64_force_relocation): Likewise.

gas/testsuite/
  * gas/aarch64/reloc-dtprel_lo12-1.s: New testcase.
  * gas/aarch64/reloc-dtprel_lo12-ilp32-1.s: Likewise.
  * gas/aarch64/reloc-dtprel_lo12-1.d: New expectation file.
  * gas/aarch64/reloc-dtprel_lo12-ilp32-1.d: Likewise.
2015-08-11 21:26:31 +01:00
Jiong Wang 73f925cc20 [AArch64][6/8] LD support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
  BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
  (aarch64_reloc_got_type): Likewise.
  (elfNN_aarch64_final_link_relocate): Likewise.
  (elfNN_aarch64_relocate_section): Likewise.
  (elfNN_aarch64_gc_sweep_hook): Likewise.
  (elfNN_aarch64_check_relocs): Likewise.
  * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
  (_bfd_aarch64_elf_resolve_relocation): Likewise.

ld/testsuite/
  * ld-aarch64/tls-small-ld.s: Update testcase.
2015-08-11 21:26:13 +01:00
Jiong Wang a12fad50d2 [AArch64][5/8] GAS support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
  (aarch64_force_relocation): Likewise.

gas/testsuite/
  * gas/aarch64/reloc-tlsldm_lo12_nc-1.s: New testcase.
  * gas/aarch64/reloc-tlsldm_lo12_nc-ilp32-1.s: Likewise.
  * gas/aarch64/reloc-tlsldm_lo12_nc-1.d: New expectation file.
  * gas/aarch64/reloc-tlsldm_lo12_nc-ilp32-1.d: Likewise.
2015-08-11 21:25:51 +01:00
Jiong Wang 56a2e4507a [AArch64][4/8] Add R_AARCH64_P32_TLSLD_ADD_LO12_NC in elf header
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

include/elf/
  * aarch64.h (R_AARCH64_P32_TLSLD_ADD_LO12_NC): Define.
2015-08-11 21:25:32 +01:00
Jiong Wang f69e49203b [AArch64][3/8] LD support BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
  BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
  (aarch64_reloc_got_type): Likewise.
  (elfNN_aarch64_final_link_relocate): Likewise.
  (elfNN_aarch64_relocate_section): Likewise.
  (elfNN_aarch64_gc_sweep_hook): Likewise.
  (elfNN_aarch64_check_relocs): Likewise.
  * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
  (_bfd_aarch64_elf_resolve_relocation): Likewise.

ld/testsuite/
  * ld-aarch64/tls-small-ld.s: New file.
  * ld-aarch64/tls-small-ld.d: Likewise.
  * ld-aarch64/aarch64-elf.exp: Run new test.
2015-08-11 21:25:04 +01:00
Jiong Wang 1107e076cf [AArch64][2/8] GAS support BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
  (aarch64_force_relocation): Likewise.

gas/testsuite/
  * gas/aarch64/reloc-tlsldm-page-1.s: New testcase.
  * gas/aarch64/reloc-tlsldm-page-ilp32-1.s: Likewise.
  * gas/aarch64/reloc-tlsldm-page-1.d: New expectation file.
  * gas/aarch64/reloc-tlsldm-page-ilp32-1.d: Likewise.
2015-08-11 21:24:38 +01:00
Jiong Wang 2c0a466a7f [AArch64][1/8] Add R_AARCH64_P32_TLSLD_ADR_PAGE21 in elf header
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

include/elf/
  * aarch64.h (R_AARCH64_P32_TLSLD_ADR_PAGE21): Define.
2015-08-11 21:15:52 +01:00
H.J. Lu 97dc35c88d Skip IFUNC relocations in debug sections
Skip IFUNC relocations in debug sections ignored by ld.so.

bfd/

	PR ld/18808
	* elf32-i386.c (elf_i386_relocate_section): Skip IFUNC
	relocations in debug sections.
	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.

ld/testsuite/

	PR ld/18808
	* ld-ifunc/ifunc.exp: Add a test for PR ld/18808.
	* ld-ifunc/pr18808.out: New file.
	* ld-ifunc/pr18808a.c: Likewise.
	* ld-ifunc/pr18808b.c: Likewise.
2015-08-11 12:59:11 -07:00
Nick Clifton 922c5db5e7 Fix the disassembly of the AArch64 SIMD EXT instruction.
PR 18800
	* aarch64-tbl.h (aarch64_opcode_table): Fix mask for SIMD EXT
	instruction.
2015-08-11 18:00:36 +01:00
Peter Zotov dbac553d28 Fix encoding or OpenRisk1000 PC relative relocations.
PR ld/18759
	* elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE.
	(R_OR1K_16_PCREL): Likewise.
	(R_OR1K_8_PCREL): Likewise.
2015-08-11 17:12:21 +01:00
Nick Clifton 4c0160b8e2 Fix typo in coff-sh.c.
PR binutils/18747
	* coff-sh.c (_bfd_sh_align_load_span): Fix typo when setting
	opcode count.
2015-08-11 17:02:25 +01:00
Alan Modra c8373ebb4e Tweak binutils testsuite
Some targets provide aligned .bss sections, so explicitly align.
msp430 and rl78 emit "magic" symbols when assembling symbol.s, and
mips targets emit STT_OBJECT rather than STT_NOTYPE syms.

	* binutils-all/strip-12.s: Align .bss section.
	* binutils-all/strip-12.d: Adjust.
	* binutils-all/symbols-1.d: Allow extraneous symbols.
	* binutils-all/symbols-2.d: Likewise, and V for weakened syms.
	* binutils-all/symbols-3.d: Likewise.
	* binutils-all/symbols-4.d: Likewise.
2015-08-11 23:29:36 +09:30
Nick Clifton 4b0e8a5f80 Fix memory access problems discovered when running some binary tools on corrupt files.
PR binutils/18758
	* elf.c (_bfd_elf_setup_sections): Add checks for corrupt section
	group information.
	* peicode.h (pe_ILF_make_a_section): Ensure alignment of the
	used_by_bfd pointer.
	(pe_ILF_build_a_bfd): Ensure alignment of vars.data pointer.
2015-08-11 11:57:09 +01:00
H.J. Lu 64140f86ab Fix a typo in _bfd_elf_copy_private_bfd_data
* elf.c (_bfd_elf_copy_private_bfd_data): Fix a typo.
2015-08-11 03:50:17 -07:00
Nick Clifton eff0bc54a3 Fix compile time warning messages about constant expressions where a value is being shifted into bit 31.
PR gas/18765
	* config/tc-arm.c (move_or_literal_pool): Use U suffix to remove
	compile time warnings about constant expressions being shifted
	into bit 31.
	(do_iwmmxt_wldstd): Likewise.
	(do_iwmmxt_wrwrwr_or_imm5): Likewise.
	(md_assemble): Likewise.
2015-08-11 10:07:21 +01:00
Nick Clifton e66c3c2568 Convert 'A && (!A || B)' to 'A || B' in various places.
PR gas/18574
	* config/tc-msp430.c (msp430_operands): Rewrite if statements to
	remove redundant checks.
	(md_apply_fix): Likewise.
2015-08-11 09:49:18 +01:00
Nick Clifton d29b2a1ece Fix typo checking MMIX operands.
PR gas/18677
	* config/tc-mmix.c (md_assemble): Fix typo checking operands with
	a numeric constant value.
2015-08-11 09:43:16 +01:00
Nick Clifton 88fd0449a3 Fix typo checking number of operands.
PR gas/18678
	* config/tc-tic4x.c (tic4x_insn_check): Fix typo.
2015-08-11 09:40:02 +01:00
Nick Clifton 2b29bb41d5 Fix a typo where the same name was checked twice.
PR gas/18679
	* config/xtensa-relax.c (same_operand_name): Fix typo.
2015-08-11 09:36:57 +01:00
Iain Buclaw 3037929188 PR gdb/18669 libiberty demangle.test failure: strtod() on sparc-sun-solaris2.9
Test symbols did not demangle as per the d-demangle-expected tests because
strtod() on Solaris 9 does not accept hexadecimal numbers.

This has now been fixed up so that no attempt at formatting/converting the
demangled hexadecimal literals are done.

libiberty/ChangeLog:

2015-08-11  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-demangle.c (dlang_parse_real): Remove call to strtod.
	(strtod): Remove declaration.
	* testsuite/d-demangle-expected: Update float and complex literal
	tests to check correct hexadecimal demangling.
2015-08-11 09:14:12 +02:00
GDB Administrator 125453567f Automatic date update in version.in 2015-08-11 00:00:08 +00:00
Doug Evans 80af41e003 remove trailing space in previous entry 2015-08-10 13:36:36 -07:00
Doug Evans e27852be65 PR gdb/17960 Internal error: tracker != NULL when completing on file:function
gdb/ChangeLog:

	* symtab.c (make_file_symbol_completion_list_1): Renamed from
	make_file_symbol_completion_list and made static.
	(make_file_symbol_completion_list): New function.

gdb/testsuite/ChangeLog:

	* gdb.base/completion.exp: Add location completer tests.
2015-08-10 12:23:09 -07:00
Joel Brobecker fd7dcb94cb gdb/infrun.c: Various trivial ARI fixes.
gdb/ChangeLog:

        * infrun.c (follow_fork, displaced_step_prepare, resume): Remove
        trailing new-line at end of warning message.
        (proceed): Add i18n marker to error messages.
2015-08-10 11:07:56 -07:00
H.J. Lu 422f11824b Replace hidden with versioned in elf_link_hash_entry
This patch replaces the "hidden" field with the "versioned" field in
elf_link_hash_entry so that we can avoid calling strchr and strrchr if
the symbol is unversioned.

	* elf-bfd.h (elf_symbol_version): New enum.
	(elf_link_hash_entry): Replace hidden with versioned.
	* elflink.c (_bfd_elf_merge_symbol): Don't look for symbol
	version if the symbol is unversioned.  Initialize versioned.
	(_bfd_elf_add_default_symbol): Don't look for symbol version
	if the symbol is unversioned or hidden.  Initialize versioned.
	(elf_collect_hash_codes): Don't look for symbol version if the
	symbol is unversioned.
	(elf_collect_gnu_hash_codes): Likewise.
	(bfd_elf_gc_mark_dynamic_ref_symbol): Likewise.
	(_bfd_elf_link_hash_copy_indirect): Check versioned instead of
	hidden.
	(elf_link_output_extsym): Likewise.
2015-08-10 07:57:57 -07:00
Robert Suchanek 75fb7498c2 Add SIGRIE instruction for MIPS R6
opcodes/

	* mips-opc.c (mips_builtin_opcodes): Add "sigrie".

gas/testsuite/

	* gas/mips/r6.s: Add tests for "sigrie".
	* gas/mips/r6.d: Check for "sigrie".
	* gas/mips/r6-n32.d: Likewise.
	* gas/mips/r6-n64.d: Likewise.
2015-08-10 09:14:07 +01:00
GDB Administrator 2bc6d61bf3 Automatic date update in version.in 2015-08-10 00:00:08 +00:00
GDB Administrator 662a7b62c4 Automatic date update in version.in 2015-08-09 00:00:07 +00:00
Hans-Peter Nilsson 8fe3f3d6af tc-arm.c: Append ULL to 0xFFFFFFFFFFFFF to avoid errors on 32-bit hosts. 2015-08-08 22:44:37 +02:00