binutils-gdb.git
8 years agoFix -exec-run not running asynchronously with mi-async on (PR gdb/18077)
Simon Marchi [Tue, 17 May 2016 20:44:57 +0000 (16:44 -0400)]
Fix -exec-run not running asynchronously with mi-async on (PR gdb/18077)

When doing -exec-run on a freshly started GDB, the only target on the
target stack at the time the dummy one.  When mi_async_p is called to
know whether the run should be async, it queries whether the current
target (dummy) supports async, and the answer is no.  The fix is to make
the code query the target that will be used for the run, which is not
necessarily the current target.

No regressions in the gdb.mi directory using the unix, native-gdbserver
and native-extended-gdbserver boards.  The test doesn't pass when
forcing maint set target-async off, obviously, since it makes mi-async
have no effect.  It doesn't seem like other tests are checking for that
eventuality, so I didn't in the new test.

gdb/ChangeLog:

* mi/mi-main.c (run_one_inferior): Use run target to determine
whether to run async or not.
(mi_cmd_exec_run): Likewise.

gdb/testsuite/ChangeLog:

* gdb.mi/mi-async-run.exp: New file.
* gdb.mi/mi-async-run.c: New file.

8 years agoRename OP_F90_RANGE to OP_RANGE.
Tom Tromey [Wed, 27 Apr 2016 16:28:56 +0000 (10:28 -0600)]
Rename OP_F90_RANGE to OP_RANGE.

This renames OP_F90_RANGE to OP_RANGE, and similarly renames the
f90_range_type enum.

2016-05-17  Tom Tromey  <tom@tromey.com>

* std-operator.def (OP_RANGE): Rename from OP_F90_RANGE.
* rust-lang.c: Don't include f-lang.h.
(rust_range, rust_compute_range, rust_subscript)
(rust_evaluate_subexp): Update.
* rust-exp.y: Don't include f-lang.h.
(ast_range, convert_ast_to_expression): Update.
* parse.c (operator_length_standard): Update.
* f-lang.h (enum f90_range_type): Move to expression.h.
* f-exp.y: Use OP_RANGE.
* expression.h (enum range_type): New enum; renamed from
f90_range_type.
* expprint.c: Don't include f-lang.h.
(print_subexp_standard, dump_subexp_body_standard): Use OP_RANGE.
* eval.c (value_f90_subarray, evaluate_subexp_standard): Update.

8 years agoAdd Rust documentation
Tom Tromey [Wed, 27 Apr 2016 01:38:56 +0000 (19:38 -0600)]
Add Rust documentation

This patch adds documentation for the new Rust support in gdb.

2016-05-17  Tom Tromey  <tom@tromey.com>

* NEWS: Add Rust item.

2016-05-17  Tom Tromey  <tom@tromey.com>

* gdb.texinfo (Supported Languages): Mention Rust.  Update menu.
(Rust): New node.

8 years agoUpdate gdb test suite for Rust
Tom Tromey [Wed, 27 Apr 2016 01:38:43 +0000 (19:38 -0600)]
Update gdb test suite for Rust

This updates the gdb test suite for Rust.

2016-05-17  Tom Tromey  <tom@tromey.com>
    Manish Goregaokar <manishsmail@gmail.com>

* lib/rust-support.exp: New file.
* lib/gdb.exp (skip_rust_tests): New proc.
(build_executable_from_specs): Handle rust.
* lib/future.exp (gdb_find_rustc): New proc.
(gdb_default_target_compile): Handle rust.
* gdb.rust/expr.exp: New file.
* gdb.rust/generics.exp: New file.
* gdb.rust/generics.rs: New file.
* gdb.rust/methods.exp: New file.
* gdb.rust/methods.rs: New file.
* gdb.rust/modules.exp: New file.
* gdb.rust/modules.rs: New file.
* gdb.rust/simple.exp: New file.
* gdb.rust/simple.rs: New file.

8 years agoAdd support for the Rust language
Tom Tromey [Wed, 27 Apr 2016 01:38:08 +0000 (19:38 -0600)]
Add support for the Rust language

This patch adds support for the Rust language.

2016-05-17  Tom Tromey  <tom@tromey.com>
    Manish Goregaokar <manishsmail@gmail.com>

* symtab.c (symbol_find_demangled_name): Handle Rust.
* symfile.c (init_filename_language_table): Treat ".rs" as Rust.
* std-operator.def (STRUCTOP_ANONYMOUS, OP_RUST_ARRAY): New
constants.
* rust-lang.h: New file.
* rust-lang.c: New file.
* rust-exp.y: New file.
* dwarf2read.c (read_file_scope): Add Rust producer sniffing.
(dwarf2_compute_name, read_func_scope, read_structure_type)
(read_base_type, read_subrange_type, set_cu_language)
(new_symbol_full, determine_prefix): Handle Rust.
* defs.h (enum language) <language_rust>: New constant.
* Makefile.in (SFILES): Add rust-exp.y, rust-lang.c.
(COMMON_OBS): Add rust-exp.o, rust-lang.o.

2016-05-17  Tom Tromey  <tom@tromey.com>

* gdb.base/default.exp (set language): Add rust.

8 years agoAdd array start and end strings to generic_val_print_decorations
Tom Tromey [Tue, 26 Apr 2016 22:45:21 +0000 (16:45 -0600)]
Add array start and end strings to generic_val_print_decorations

For Rust value-printing, I wanted to use generic_val_print_array, but
I also wanted to control the starting and ending strings.

This patch adds new strings to generic_val_print_decorations, updates
generic_val_print_array to use them, and updates all the existing
instances of generic_val_print_decorations.

2016-05-17  Tom Tromey  <tom@tromey.com>

* valprint.h (struct generic_val_print_array) <array_start,
array_end>: New fields.
* valprint.c (generic_val_print_array): Add "decorations"
parameter.  Use "array_start", "array_end".
(generic_val_print) <TYPE_CODE_ARRAY>: Update.
* p-valprint.c (p_decorations): Update.
* m2-valprint.c (m2_decorations): Update.
* f-valprint.c (f_decorations): Update.
* c-valprint.c (c_decorations): Update.

8 years agoAdd self-test framework to gdb
Tom Tromey [Wed, 20 Apr 2016 16:09:53 +0000 (10:09 -0600)]
Add self-test framework to gdb

I wanted to unit test the Rust lexer, so I added a simple unit testing
command to gdb.

The intent is that self tests will only be compiled into gdb in
development mode.  In release mode they simply won't exist.  So, this
exposes $development to C code as GDB_SELF_TEST.

In development mode, test functions are registered with the self test
module.  A test function is just a function that does some checks, and
throws an exception on failure.

Then this adds a new "maint selftest" command which invokes the test
functions, and a new dejagnu test case that invokes it.

2016-05-17  Tom Tromey  <tom@tromey.com>

* NEWS: Add "maint selftest" entry.
* selftest.h: New file.
* selftest.c: New file.
* maint.c: Include selftest.h.
(maintenance_selftest): New function.
(_initialize_maint_cmds): Add "maint selftest" command.
* configure.ac (GDB_SELF_TEST): Maybe define.
* config.in, configure: Rebuild.
* Makefile.in (SFILES): Add selftest.c.
(COMMON_OBS): Add selftest.o.

2016-05-17  Tom Tromey  <tom@tromey.com>

* gdb.texinfo (Maintenance Commands): Document "maint selftest".

2016-05-17  Tom Tromey  <tom@tromey.com>

* gdb.gdb/unittest.exp: New file.

8 years agoMake gdb expression debugging handle OP_F90_RANGE
Tom Tromey [Wed, 20 Apr 2016 14:14:16 +0000 (08:14 -0600)]
Make gdb expression debugging handle OP_F90_RANGE

print_subexp_standard and dump_subexp_body_standard did not handle
OP_F90_RANGE.  Attempting to dump an expression using this opcode
would fail.

This patch adds support for this opcode to these functions.

2016-05-17  Tom Tromey  <tom@tromey.com>

* expprint.c: Include f-lang.h.
(print_subexp_standard, dump_subexp_body_standard): Handle
OP_F90_RANGE.

8 years agoFix latent yacc-related bug in gdb/Makefile.in init.c rule
Tom Tromey [Thu, 31 Mar 2016 20:16:56 +0000 (14:16 -0600)]
Fix latent yacc-related bug in gdb/Makefile.in init.c rule

gdb's Makefile.in does not currently scan .y files to add global
initializers from these files to init.c.  However, at least ada-exp.y
tries to use this feature.

This patch fixes the problem.

2016-05-17  Tom Tromey  <tom@tromey.com>

* Makefile.in (init.c): Search .y files for initialization
functions.

8 years agoAdd DW_LANG_Rust
Tom Tromey [Mon, 16 May 2016 18:21:49 +0000 (12:21 -0600)]
Add DW_LANG_Rust

include/
* dwarf2.h (enum dwarf_source_language) <DW_LANG_Rust,
DW_LANG_Rust_old>: New constants.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235643 138bc75d-0d04-0410-961f-82ee72b054a4

8 years agoCheck global CC in at_least_gcc_version
H.J. Lu [Tue, 17 May 2016 16:55:05 +0000 (09:55 -0700)]
Check global CC in at_least_gcc_version

at_least_gcc_version should check global CC.

* testsuite/lib/ld-lib.exp (at_least_gcc_version): Check
global CC.

8 years agoFix date in ChangeLog
H.J. Lu [Tue, 17 May 2016 16:53:44 +0000 (09:53 -0700)]
Fix date in ChangeLog

8 years agoMake ARMv8-M GAS tests pass on non ELF targets
Thomas Preud'homme [Tue, 17 May 2016 15:35:12 +0000 (16:35 +0100)]
Make ARMv8-M GAS tests pass on non ELF targets

2016-05-17  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
* testsuite/gas/arm/archv8m-cmse-msr-base.d: Force Thumb when
disassembling and stop skipping targets.
* testsuite/gas/arm/archv8m-cmse-msr-main.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-4.d: Likewise.
* testsuite/gas/arm/archv8m-base.d: Also allow nops after the last
instruction for targets that have stronger alignment requirement.
* testsuite/gas/arm/archv8m-cmse-base.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-main-1.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-main-2.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-1.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-2.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-3.d: Likewise.
* testsuite/gas/arm/archv8m-main.d: Likewise.
* testsuite/gas/arm/archv8m.s: Add label.
* testsuite/gas/arm/archv8m-cmse.s: Likewise.
* testsuite/gas/arm/archv8m-cmse-msr.s: Likewise.
* testsuite/gas/arm/archv8m-cmse-main.s: Likewise.

8 years agoPlace progmem data from AVR's libc before other progmem data.
Senthil Kumar Selvaraj [Tue, 17 May 2016 12:14:26 +0000 (13:14 +0100)]
Place progmem data from AVR's libc before other progmem data.

* scripttempl/avr.sc (text): Place .progmem.data from avr-libc
above .progmem*.
* scripttempl/avrtiny.sc (text): Likewise.

8 years agoLD/ELF: Unify STB_GNU_UNIQUE handling
Maciej W. Rozycki [Mon, 16 May 2016 07:51:26 +0000 (08:51 +0100)]
LD/ELF: Unify STB_GNU_UNIQUE handling

Take STB_GNU_UNIQUE handling scattered across targets and gather it in
the generic ELF linker.  Update test suite infrastructure accordingly.

bfd/
* elf-s390-common.c (elf_s390_add_symbol_hook): Remove
STB_GNU_UNIQUE handling.
* elf32-arc.c (elf_arc_add_symbol_hook): Likewise.
* elf32-arm.c (elf32_arm_add_symbol_hook): Likewise.
* elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
* elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
* elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
* elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
* elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
* elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
* elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
* elf32-i386.c (elf_i386_add_symbol_hook): Remove function.
(elf_backend_add_symbol_hook): Remove macro.
* elflink.c (elf_link_add_object_symbols): Set `has_gnu_symbols'
for STB_GNU_UNIQUE symbols.

binutils/
* testsuite/lib/binutils-common.exp (supports_gnu_unique): New
procedure.
* testsuite/binutils-all/objcopy.exp: Use `supports_gnu_unique'
with the `strip-10' test.

ld/
* testsuite/ld-unique/unique.exp: Use `is_elf_format' and
`supports_gnu_unique' to qualify testing.

8 years agoUse unsuspend_all_lwps
Yao Qi [Tue, 17 May 2016 07:24:26 +0000 (08:24 +0100)]
Use unsuspend_all_lwps

This patch is to replace find_inferior (&all_threads, unsuspend_one_lwp, NULL)
with unsuspend_all_lwps (NULL), which is shorter.  They are equivalent
to each other.

gdb/gdbserver:

2016-05-17  Yao Qi  <yao.qi@linaro.org>

* linux-low.c (linux_stabilize_threads): Call unsuspend_all_lwps
instead of find_inferior.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 17 May 2016 00:00:18 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoMatch shell_prompt # in batch-preserve-term-settings.exp
Yao Qi [Mon, 16 May 2016 16:32:43 +0000 (17:32 +0100)]
Match shell_prompt # in batch-preserve-term-settings.exp

batch-preserve-term-settings.exp fails if the shell prompt isn't $.  It
is # in our testing env.  In fact, the shell prompt can be anything.

The perfect solution would be "set_board_info shell_prompt" in the
host board file, and use board_info shell_prompt in
batch-preserve-term-settings.exp.  This is a little bit overkill to
me, and we still need to figure out the different prompts on different
shells.  I also tried to start shell with the prompt preset, but there is
not unique way to set shell prompt in different shells, so I give up.

It is reasonably simple to match either $ or # for the shell prompt, and
we can easily extend it to match other char, like >.

gdb/testsuite:

2016-05-16  Yao Qi  <yao.qi@linaro.org>

* gdb.base/batch-preserve-term-settings.exp: Remove variable
shell_prompt.  Update shell_prompt_re.

8 years agoV850/BFD: Call `_bfd_elf_copy_private_bfd_data' again
Maciej W. Rozycki [Mon, 16 May 2016 07:22:59 +0000 (08:22 +0100)]
V850/BFD: Call `_bfd_elf_copy_private_bfd_data' again

Correct a regression introduced with commit 685080f21003 ("Adds support
for generating notes in V850 binaries.") which replaced rather than
extending the call to `_bfd_elf_copy_private_bfd_data' with
`v850_elf_copy_private_bfd_data'.  Consequently ELFOSABI_GNU marking is
not propagated to output by `objcopy' from objects containing
STB_GNU_UNIQUE symbols.

bfd/
* elf32-v850.c (v850_elf_copy_notes): New function, factored out
from...
(v850_elf_copy_private_bfd_data): ... here.  Call the new
function and `_bfd_elf_copy_private_bfd_data'.

binutils/
* testsuite/binutils-all/objcopy.exp: Don't skip the `strip-10'
test for the V850.

8 years agom32r: make mach_table static and const
Trevor Saunders [Sat, 14 May 2016 20:31:45 +0000 (16:31 -0400)]
m32r: make mach_table static and const

It is only read in tc-m32r.c, so it might as well be static and const, and
that should help the compiler slightly.

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-m32r.c (mach_table): Make static and const.

8 years agotc-vax.c: make prototype of flonum_gen2vax match its definition
Trevor Saunders [Sat, 14 May 2016 06:34:02 +0000 (02:34 -0400)]
tc-vax.c: make prototype of flonum_gen2vax match its definition

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-vax.c (flonum_gen2vax): Adjust prototype to match
definition.

8 years agostop defining linkrelax in multiple places
Trevor Saunders [Sat, 14 May 2016 04:34:05 +0000 (00:34 -0400)]
stop defining linkrelax in multiple places

Defining linkrelax to have different values in as.c and tc-msp430.c /
tc-mn10300.c is at least rather tricky, and seems fragile, when we can just set
it in md_begin instead.

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-mn10300.c (md_begin): set linkrelax here instead of
defining it.
* config/tc-msp430.c (md_begin): Likewise.

8 years agom68hc11: make some vars type bfd_reloc_code_real_type
Trevor Saunders [Sat, 14 May 2016 19:27:26 +0000 (15:27 -0400)]
m68hc11: make some vars type bfd_reloc_code_real_type

These variables only hold values from the bfd_reloc_code_real_type enum, and
are passed to functions that expect the argument to be of type
bfd_reloc_code_real_type, so it seems to make sense that there type is
bfd_reloc_code_real_type rather than int.

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-m68hc11.c (fixup8): Change variables type from int to
bfd_reloc_code_real_type where appropriate.
(fixup16): Likewise.
(fixup8_xg): Likewise.

8 years agold/testsuite/ld-elf/flags1.d: Update the xfail list
Maciej W. Rozycki [Sun, 15 May 2016 05:49:54 +0000 (06:49 +0100)]
ld/testsuite/ld-elf/flags1.d: Update the xfail list

Update to match commit 924bc11ba455 ("Update section merge test.").

ld/
* testsuite/ld-elf/flags1.d: Update the xfail list.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 16 May 2016 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoSH64/GAS: Fix a -Wwrite-strings build failure
Maciej W. Rozycki [Sun, 15 May 2016 22:14:52 +0000 (23:14 +0100)]
SH64/GAS: Fix a -Wwrite-strings build failure

Fix a commit 6757cf57697d ("enable -Wwrite-strings for gas") regression.

gas/
* config/tc-sh64.c (shmedia_check_limits): Constify `msg'.

8 years agold/testsuite/ld-elf/flags1.d: Update for `*-*-nacl*' xfail removal
Maciej W. Rozycki [Sun, 15 May 2016 05:39:14 +0000 (06:39 +0100)]
ld/testsuite/ld-elf/flags1.d: Update for `*-*-nacl*' xfail removal

ld/
* testsuite/ld-elf/flags1.d: Update for `*-*-nacl*' xfail
removal.

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 15 May 2016 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoRemove redundant sizeof on EXPECTED_VIEW_LENGTH
H.J. Lu [Sat, 14 May 2016 12:51:28 +0000 (05:51 -0700)]
Remove redundant sizeof on EXPECTED_VIEW_LENGTH

PR ld/20097
* testplug2.c (onall_symbols_read): Remove redundant sizeof
on EXPECTED_VIEW_LENGTH.
* testplug4.c (onall_symbols_read): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 14 May 2016 00:00:14 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAccept valid one byte signed and unsigned values for the IMM8 operand.
Peter Bergner [Fri, 13 May 2016 20:15:00 +0000 (15:15 -0500)]
Accept valid one byte signed and unsigned values for the IMM8 operand.

opcodes/
* ppc-opc.c (IMM8): Use PPC_OPERAND_SIGNOPT.

gas/
* testsuite/gas/ppc/power9.d <xxspltib>: Add additional operand tests.
* testsuite/gas/ppc/power9.s: Likewise.

8 years agoDon't convert GOTPCREL relocation against large section
H.J. Lu [Fri, 13 May 2016 17:59:32 +0000 (10:59 -0700)]
Don't convert GOTPCREL relocation against large section

bfd/

PR ld/20093
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Don't convert
GOTPCREL relocation against large section.

ld/

PR ld/20093
* testsuite/ld-x86-64/pr20093-1.d: New file.
* testsuite/ld-x86-64/pr20093-1.s: Likewise.
* testsuite/ld-x86-64/pr20093-2.d: Likewise.
* testsuite/ld-x86-64/pr20093-2.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr20093-1 and pr20093-2.

8 years agoFix build breakage
Alan Modra [Fri, 13 May 2016 06:27:10 +0000 (15:57 +0930)]
Fix build breakage

* config/obj-coff.c (weak_uniquify): Delete unused var.

8 years agoSet dynamic tag VMA and size from dynamic section when possible
Alan Modra [Fri, 13 May 2016 02:18:56 +0000 (11:48 +0930)]
Set dynamic tag VMA and size from dynamic section when possible

Rather than searching the output for a specific named section, it's
better, where possible, to use a linker created dynamic section to set
a dynamic tag's value.  That way ld doesn't depend on the output
section name, making it possibile to map dynamic sections differently.

bfd/
* elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_sections): Use
linker dynamic sections in calculating size and address of
* dynamic tags rather than using output sections.  Remove asserts.
* elf32-arm.c (elf32_arm_finish_dynamic_sections): Likewise.
* elf32-cr16.c (_bfd_cr16_elf_finish_dynamic_sections): Likewise.
* elf32-cris.c (elf_cris_finish_dynamic_sections): Likewise.
* elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise.
* elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
* elf32-m32r.c (m32r_elf_finish_dynamic_sections): Likewise.
* elf32-m68k.c (elf_m68k_finish_dynamic_sections): Likewise.
* elf32-metag.c (elf_metag_finish_dynamic_sections): Likewise.
* elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Likewise.
* elf32-nds32.c (nds32_elf_finish_dynamic_sections): Likewise.
* elf32-nios2.c (nios2_elf32_finish_dynamic_sections): Likewise.
* elf32-or1k.c (or1k_elf_finish_dynamic_sections): Likewise.
* elf32-s390.c (elf_s390_finish_dynamic_sections): Likewise.
* elf32-score.c (s3_bfd_score_elf_finish_dynamic_sections): Likewise.
* elf32-score7.c (s7_bfd_score_elf_finish_dynamic_sections): Likewise.
* elf32-vax.c (elf_vax_finish_dynamic_sections): Likewise.
* elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Likewise.
* elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Likewise.
* elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
* elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
* elflink.c (bfd_elf_final_link): Likewise.
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Likewise.
* elfxx-sparc.c (sparc_finish_dyn): Likewise.  Adjust error message.
* elf32-arc.c (GET_SYMBOL_OR_SECTION): Remove ASSERT arg and
don't set doit.  Look up dynobj section.
(elf_arc_finish_dynamic_sections): Adjust GET_SYMBOL_OR_SECTION
invocation and dynamic tag vma calculation.  Don't test
boolean var == TRUE.
* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections): Fix
DT_JMPREL calc.
ld/
* testsuite/ld-arm/arm-elf.exp: Adjust for arm-no-rel-plt now passing.
Use different output file name for static app without .rel.plt.
* testsuite/ld-arm/arm-no-rel-plt.ld: Align .rel.dyn and .rela.dyn.
* testsuite/ld-arm/arm-no-rel-plt.out: Delete.
* testsuite/ld-arm/arm-no-rel-plt.r: New.
* testsuite/ld-arm/arm-static-app.d: Don't check file name.
* testsuite/ld-arm/arm-static-app.r: Likewise.

8 years agold -z combreloc elf_link_sort_relocs
Alan Modra [Fri, 13 May 2016 02:04:56 +0000 (11:34 +0930)]
ld -z combreloc elf_link_sort_relocs

A linker script may put .rela.plt in with other .rela.dyn relocs.
The change to elf_reloc_type_class puts any PLT relocs last.  This
patch makes the input section layout better match the sorted relocs.

* elflink.c (elf_link_sort_relocs): Wrap overlong lines.  Fix
octets_per_byte.  Put dynamic .rela.plt last in link orders.
Assign output_offset for reloc sections rather than writing
sorted relocs from block corresponding to output_offset.

8 years agouse XNEW and related macros more
Trevor Saunders [Wed, 6 Apr 2016 20:26:46 +0000 (16:26 -0400)]
use XNEW and related macros more

Its a bit shorter and simpler than raw xmalloc.

gas/ChangeLog:

2016-05-13  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* app.c (app_push): Use XNEW and related macros.
* as.c (parse_args): Likewise.
* cgen.c (make_right_shifted_expr): Likewise.
(gas_cgen_tc_gen_reloc): Likewise.
* config/bfin-defs.h: Likewise.
* config/bfin-parse.y: Likewise.
* config/obj-coff.c (stack_init): Likewise.
(stack_push): Likewise.
(coff_obj_symbol_new_hook): Likewise.
(coff_obj_symbol_clone_hook): Likewise.
(add_lineno): Likewise.
(coff_frob_symbol): Likewise.
* config/obj-elf.c (obj_elf_section_name): Likewise.
(build_group_lists): Likewise.
* config/obj-evax.c (evax_symbol_new_hook): Likewise.
* config/obj-macho.c (obj_mach_o_indirect_symbol): Likewise.
* config/tc-aarch64.c (insert_reg_alias): Likewise.
(find_or_make_literal_pool): Likewise.
(add_to_lit_pool): Likewise.
(fill_instruction_hash_table): Likewise.
* config/tc-alpha.c (load_expression): Likewise.
(emit_jsrjmp): Likewise.
(s_alpha_ent): Likewise.
(s_alpha_end): Likewise.
(s_alpha_linkage): Likewise.
(md_begin): Likewise.
(tc_gen_reloc): Likewise.
* config/tc-arc.c (arc_insert_opcode): Likewise.
(arc_extcorereg): Likewise.
* config/tc-bfin.c: Likewise.
* config/tc-cr16.c: Likewise.
* config/tc-cris.c: Likewise.
* config/tc-crx.c (preprocess_reglist): Likewise.
* config/tc-d10v.c: Likewise.
* config/tc-frv.c (frv_insert_vliw_insn): Likewise.
(frv_tomcat_shuffle): Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-i370.c (i370_macro): Likewise.
* config/tc-i386.c (lex_got): Likewise.
(md_parse_option): Likewise.
* config/tc-ia64.c (alloc_record): Likewise.
(set_imask): Likewise.
(save_prologue_count): Likewise.
(dot_proc): Likewise.
(dot_endp): Likewise.
(ia64_frob_label): Likewise.
(add_qp_imply): Likewise.
(add_qp_mutex): Likewise.
(mark_resource): Likewise.
(dot_alias): Likewise.
* config/tc-m68hc11.c: Likewise.
* config/tc-m68k.c (m68k_frob_label): Likewise.
(s_save): Likewise.
(mri_control_label): Likewise.
(push_mri_control): Likewise.
(build_mri_control_operand): Likewise.
(s_mri_else): Likewise.
(s_mri_break): Likewise.
(s_mri_next): Likewise.
(s_mri_for): Likewise.
(s_mri_endw): Likewise.
* config/tc-metag.c (create_mnemonic_htab): Likewise.
* config/tc-microblaze.c: Likewise.
* config/tc-mmix.c (s_loc): Likewise.
* config/tc-nds32.c (nds32_relax_hint): Likewise.
* config/tc-nios2.c (nios2_insn_reloc_new): Likewise.
* config/tc-rl78.c: Likewise.
* config/tc-rx.c (rx_include): Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh64.c (shmedia_frob_section_type): Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-spu.c: Likewise.
* config/tc-tic6x.c (static tic6x_unwind_info *tic6x_get_unwind): Likewise.
(tic6x_start_unwind_section): Likewise.
* config/tc-tilegx.c: Likewise.
* config/tc-tilepro.c: Likewise.
* config/tc-v850.c: Likewise.
* config/tc-visium.c: Likewise.
* config/tc-xgate.c: Likewise.
* config/tc-xtensa.c (xtensa_translate_old_userreg_ops): Likewise.
(new_resource_table): Likewise.
(resize_resource_table): Likewise.
(xtensa_create_trampoline_frag): Likewise.
(xtensa_maybe_create_literal_pool_frag): Likewise.
(cache_literal_section): Likewise.
* config/xtensa-relax.c (append_transition): Likewise.
(append_condition): Likewise.
(append_value_condition): Likewise.
(append_constant_value_condition): Likewise.
(append_literal_op): Likewise.
(append_label_op): Likewise.
(append_constant_op): Likewise.
(append_field_op): Likewise.
(append_user_fn_field_op): Likewise.
(enter_opname_n): Likewise.
(enter_opname): Likewise.
(split_string): Likewise.
(parse_insn_templ): Likewise.
(clone_req_or_option_list): Likewise.
(clone_req_option_list): Likewise.
(parse_option_cond): Likewise.
(parse_insn_pattern): Likewise.
(parse_insn_repl): Likewise.
(build_transition): Likewise.
(build_transition_table): Likewise.
* dw2gencfi.c (alloc_fde_entry): Likewise.
(alloc_cfi_insn_data): Likewise.
(cfi_add_CFA_remember_state): Likewise.
(dot_cfi_escape): Likewise.
(dot_cfi_fde_data): Likewise.
(select_cie_for_fde): Likewise.
* dwarf2dbg.c (dwarf2_directive_loc): Likewise.
* ecoff.c (ecoff_add_bytes): Likewise.
(ecoff_build_debug): Likewise.
* input-scrub.c (input_scrub_push): Likewise.
(input_scrub_begin): Likewise.
(input_scrub_next_buffer): Likewise.
* itbl-ops.c (append_insns_as_macros): Likewise.
(alloc_entry): Likewise.
(alloc_field): Likewise.
* listing.c (listing_newline): Likewise.
(listing_listing): Likewise.
* macro.c (get_any_string): Likewise.
(delete_macro): Likewise.
* stabs.c (generate_asm_file): Likewise.
(stabs_generate_asm_lineno): Likewise.
* subsegs.c (subseg_change): Likewise.
(subseg_get): Likewise.
* symbols.c (define_dollar_label): Likewise.
(symbol_relc_make_sym): Likewise.
* write.c (write_relocs): Likewise.

8 years agouse xstrdup, xmemdup0 and concat more
Trevor Saunders [Mon, 28 Mar 2016 09:49:15 +0000 (05:49 -0400)]
use xstrdup, xmemdup0 and concat more

gas/ChangeLog:

2016-05-13  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/obj-coff.c (obj_coff_def): Simplify string copying.
(weak_name2altname): Likewise.
(weak_uniquify): Likewise.
(obj_coff_section): Likewise.
(obj_coff_init_stab_section): Likewise.
* config/obj-elf.c (obj_elf_section_name): Likewise.
(obj_elf_init_stab_section): Likewise.
* config/obj-evax.c (evax_shorten_name): Likewise.
* config/obj-macho.c (obj_mach_o_make_or_get_sect): Likewise.
* config/tc-aarch64.c (create_register_alias): Likewise.
* config/tc-alpha.c (load_expression): Likewise.
(s_alpha_file): Likewise.
(s_alpha_section_name): Likewise.
(tc_gen_reloc): Likewise.
* config/tc-arc.c (md_assemble): Likewise.
* config/tc-arm.c (create_neon_reg_alias): Likewise.
(start_unwind_section): Likewise.
* config/tc-hppa.c (pa_build_unwind_subspace): Likewise.
(hppa_elf_mark_end_of_function): Likewise.
* config/tc-nios2.c (nios2_modify_arg): Likewise.
(nios2_negate_arg): Likewise.
* config/tc-rx.c (rx_section): Likewise.
* config/tc-sh64.c (sh64_consume_datalabel): Likewise.
* config/tc-tic30.c (tic30_find_parallel_insn): Likewise.
* config/tc-tic54x.c (tic54x_include): Likewise.
(tic54x_macro_info): Likewise.
(subsym_get_arg): Likewise.
(subsym_substitute): Likewise.
(tic54x_start_line_hook): Likewise.
* config/tc-xtensa.c (xtensa_literal_prefix): Likewise.
(xg_reverse_shift_count): Likewise.
* config/xtensa-relax.c (enter_opname_n): Likewise.
(split_string): Likewise.
* dwarf2dbg.c (get_filenum): Likewise.
(process_entries): Likewise.
* expr.c (operand): Likewise.
* itbl-ops.c (alloc_entry): Likewise.
* listing.c (listing_message): Likewise.
(listing_title): Likewise.
* macro.c (check_macro): Likewise.
* stabs.c (s_xstab): Likewise.
* symbols.c (symbol_relc_make_expr): Likewise.
* write.c (compress_debug): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 13 May 2016 00:00:12 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoHandle symbols defined/referenced only within IR
H.J. Lu [Thu, 12 May 2016 23:50:34 +0000 (16:50 -0700)]
Handle symbols defined/referenced only within IR

The plugin is called to claim symbols in an archive element from
plugin_object_p.  But those symbols aren't needed to create output.
They are defined and referenced only within IR.  get_symbols should
return resolution based on IR symbol kinds.

PR ld/20070
* Makefile.am (noinst_LTLIBRARIES): Add libldtestplug4.la.
(libldtestplug4_la_SOURCES): New.
(libldtestplug4_la_CFLAGS): Likewise.
(libldtestplug4_la_LDFLAGS): Likewise.
* Makefile.in: Regenerated.
* plugin.c (get_symbols): Return resolution based on IR symbol
kinds for symbols defined/referenced only within IR.
* testplug4.c: New file.
* ld/testsuite/ld-plugin/pr20070.d: Likewise.
* ld/testsuite/ld-plugin/pr20070a.c: Likewise.
* ld/testsuite/ld-plugin/pr20070b.c: Likewise.
* testsuite/ld-plugin/plugin.exp (plugin4_name): New.
(plugin4_path): Likewise.
Add a test for ld/20070.

8 years agoPR symtab/19999 gdb unable to resolve vars with fission+PIE
Doug Evans [Thu, 12 May 2016 16:20:57 +0000 (09:20 -0700)]
PR symtab/19999 gdb unable to resolve vars with fission+PIE

gdb/ChangeLog:

* dwarf2loc.c (dwarf2_find_location_expression): For DWO files still
add base_offset.

gdb/testsuite/ChangeLog:

* lib/dwarf.exp (build_executable_from_fission_assembler): Pass
$options when building executable.
* gdb.dwarf2/fission-loclists-pie.c: New file.
* gdb.dwarf2/fission-loclists-pie.exp: New file.

8 years agoUse correct regexp syntax in ARM PR20068 test
Nick Clifton [Thu, 12 May 2016 16:19:44 +0000 (17:19 +0100)]
Use correct regexp syntax in ARM PR20068 test

8 years agold -z combreloc reloc sorting
Alan Modra [Thu, 12 May 2016 14:29:26 +0000 (23:59 +0930)]
ld -z combreloc reloc sorting

PLT relocs don't appear in .rela.dyn, at least not when using
normal linker scripts.  However, if they do, then they ought to be
placed last rather than in the middle of other relocs.

* elf-bfd.h (elf_reloc_type_class): Put reloc_class_plt last.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 12 May 2016 00:00:11 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoUpdate pr20068 test to allow for big endian ARM configuration
Nick Clifton [Wed, 11 May 2016 17:04:03 +0000 (18:04 +0100)]
Update pr20068 test to allow for big endian ARM configuration

8 years agoAdd MIPS32 DSPr3 support.
Matthew Fortune [Wed, 26 Nov 2014 11:15:01 +0000 (11:15 +0000)]
Add MIPS32 DSPr3 support.

bfd/

* elfxx-mips.c (print_mips_ases): Add DSPR3.

binutils/

* readelf.c (print_mips_ases): Add DSPR3.

gas/

* config/tc-mips.c (options): Add OPTION_DSPR3 and
OPTION_NO_DSPR3.
(md_longopts): Likewise.
(md_show_usage): Add help for -mdspr3 and -mno-dspr3.
(mips_ases): Define availability for DSPr3.
(mips_ase_groups): Add ASE_DSPR3 to the DSP group.
(mips_convert_ase_flags): Map ASE_DSPR3 to AFL_ASE_DSPR3.
* doc/as.texinfo: Document -mdspr3, -mno-dspr3.  Fix -mdspr2
formatting.
* doc/c-mips.texi: Document -mdspr3, -mno-dspr3, .set dspr3 and
.set nodspr3.  Fix -mdspr2 formatting.
* testsuite/gas/mips/mips32-dspr3.d: New file.
* testsuite/gas/mips/mips32-dspr3.s: Likewise.
* testsuite/gas/mips/mips.exp: Run mips32-dspr3 test.

include/

* elf/mips.h (AFL_ASE_DSPR3): New macro.
(AFL_ASE_MASK): Update to include AFL_ASE_DSPR3.
* opcode/mips.h (ASE_DSPR3): New macro.

opcodes/

* mips-dis.c (mips_arch_choices): Add ASE_DSPR3 to mips32r6 and
mips64r6.
* mips-opc.c (D34): New macro.
(mips_builtin_opcodes): Define bposge32c for DSPr3.

8 years ago[HPPA] Attach linker created dynamic sections to stub bfd
Alan Modra [Wed, 11 May 2016 13:21:14 +0000 (22:51 +0930)]
[HPPA] Attach linker created dynamic sections to stub bfd

bfd/
* elf32-hppa.c (elf32_hppa_init_stub_bfd): New function.
(elf32_hppa_check_relocs): Don't set dynobj.
(elf32_hppa_size_stubs): Test !SEC_LINKER_CREATED for stub sections.
(elf32_hppa_build_stubs): Likewise.
* elf32-hppa.h (elf32_hppa_init_stub_bfd): Declare.
ld/
* emultempl/hppaelf.em (hppaelf_create_output_section_statements):
Call elf32_hppa_init_stub_bfd.

8 years agold --gc-sections fail with __tls_get_addr_opt
Alan Modra [Wed, 11 May 2016 12:24:05 +0000 (21:54 +0930)]
ld --gc-sections fail with __tls_get_addr_opt

When --gc-sections is active, __tls_get_addr_opt is marked as not
needed and forced local before ppc*_elf_tls_setup is run.

bfd/
PR 20060
* elf64-ppc.c (ppc64_elf_tls_setup): Clear forced_local.
* elf32-ppc.c (ppc_elf_tls_setup): Likewise.
ld/
PR 20060
* testsuite/ld-powerpc/powerpc.exp: Run new tests.
* testsuite/ld-powerpc/tlsdll.s: New.
* testsuite/ld-powerpc/tlsdll.ver: New.
* testsuite/ld-powerpc/tlsdll_32.s: New.
* testsuite/ld-powerpc/tlsopt5.d: New.
* testsuite/ld-powerpc/tlsopt5.s: New.
* testsuite/ld-powerpc/tlsopt5_32.d: New.
* testsuite/ld-powerpc/tlsopt5_32.s: New.

8 years agoEnsure that padding in the constant pool uses constant values.
Nick Clifton [Wed, 11 May 2016 11:51:04 +0000 (12:51 +0100)]
Ensure that padding in the constant pool uses constant values.

PR target/20068
* config/tc-arm.c (add_to_lit_pool): Ensure that the padding added
to the pool uses O_constant.
* testsuite/gas/arm/pr20068.s: New test.
* testsuite/gas/arm/pr20068.d: Test driver.

8 years ago[AArch64] Remove redundant tls relax in elfNN_aarch64_final_link_relocate
Jiong Wang [Wed, 11 May 2016 10:55:02 +0000 (11:55 +0100)]
[AArch64] Remove redundant tls relax in elfNN_aarch64_final_link_relocate

bfd/
  * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Remove redundant
  aarch64_tls_transition check.

8 years agooops - fix up changelog entry
Nick Clifton [Wed, 11 May 2016 08:06:58 +0000 (09:06 +0100)]
oops - fix up changelog entry

8 years agoSkip new ARM security extension tests on non-ELF based targets.
Nick Clifton [Wed, 11 May 2016 08:04:17 +0000 (09:04 +0100)]
Skip new ARM security extension tests on non-ELF based targets.

* testsuite/gas/arm/archv8m-cmse-base.d: Skip for non-ELF ARM targets.
* testsuite/gas/arm/archv8m-cmse-main-1.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-main-2.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-msr-base.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-msr-main.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-1.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-2.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-3.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-4.d: Likewise.

8 years agofix up two issues with the removal of unused variables
Trevor Saunders [Wed, 11 May 2016 01:33:45 +0000 (21:33 -0400)]
fix up two issues with the removal of unused variables

gdb/ChangeLog:

2016-05-10  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* iq2000-tdep.c (iq2000_scan_prologue): Remove if that shouldn't guard
anything.
* linespec.c (add_sal_to_sals): Restore call to symtab_to_fullname.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 11 May 2016 00:00:18 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoEnable Intel RDPID instruction.
Alexander Fomin [Tue, 10 May 2016 18:35:52 +0000 (21:35 +0300)]
Enable Intel RDPID instruction.

This patch enables Intel RDPID instruction described in Intel64 and
IA-32 Architectures Software Developer's Manual, April 2016.

gas/

* config/tc-i386.c (cpu_arch): Add RDPID.
* doc/c-i386.texi: Document RDPID.

gas/testsuite/

* gas/i386/i386.exp: Run RDPID tests.
* gas/i386/prefix.d: Adjust.
* gas/i386/rdpid.s: New test.
* gas/i386/rdpid.d: Ditto.
* gas/i386/rdpid-intel.d: Ditto.
* gas/i386/x86-64-rdpid.s: Ditto.
* gas/i386/x86-64-rdpid.d: Ditto.
* gas/i386/x86-64-rdpid-intel.d: Ditto.

opcodes/

* i386-dis.c (prefix_table): Add RDPID instruction.
* i386-gen.c (cpu_flag_init): Add RDPID flag.
(cpu_flags): Add RDPID bitfield.
* i386-opc.h (enum): Add RDPID element.
(i386_cpu_flags): Add RDPID field.
* i386-opc.tbl: Add RDPID instruction.
* i386-init.h: Regenerate.
* i386-tbl.h: Regenerate.

8 years agoAllow veneers to claim veneered symbols
Thomas Preud'homme [Tue, 10 May 2016 15:20:19 +0000 (16:20 +0100)]
Allow veneers to claim veneered symbols

2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
* elf32-arm.c (enum elf32_arm_stub_type): New max_stub_type
enumerator.
(arm_stub_sym_claimed): New function.
(elf32_arm_create_stub): Use veneered symbol name and section if
veneer needs to claim its symbol, and keep logic unchanged otherwise.
(arm_stub_claim_sym): New function.
(arm_map_one_stub): Call arm_stub_claim_sym if veneer needs to claim
veneered symbol, otherwise create local symbol as before.

8 years agoUse getters/setters to access ARM branch type
Thomas Preud'homme [Tue, 10 May 2016 15:14:23 +0000 (16:14 +0100)]
Use getters/setters to access ARM branch type

2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
* elf32-arm.c (elf32_arm_size_stubs): Use new macros
ARM_GET_SYM_BRANCH_TYPE and ARM_SET_SYM_BRANCH_TYPE to respectively get
and set branch type of a symbol.
(bfd_elf32_arm_process_before_allocation): Likewise.
(elf32_arm_relocate_section): Likewise and fix identation along the
way.
(allocate_dynrelocs_for_symbol): Likewise.
(elf32_arm_finish_dynamic_symbol): Likewise.
(elf32_arm_swap_symbol_in): Likewise.
(elf32_arm_swap_symbol_out): Likewise.

gas/
* config/tc-arm.c (arm_adjust_symtab): Use ARM_SET_SYM_BRANCH_TYPE to
set branch type of a symbol.

gdb/
* arm-tdep.c (arm_elf_make_msymbol_special): Use
ARM_GET_SYM_BRANCH_TYPE to get branch type of a symbol.

include/
* arm.h (enum arm_st_branch_type): Add new ST_BRANCH_ENUM_SIZE
enumerator.
(NUM_ENUM_ARM_ST_BRANCH_TYPE_BITS): New macro.
(ENUM_ARM_ST_BRANCH_TYPE_BITMASK): Likewise.
(ARM_SYM_BRANCH_TYPE): Replace by ...
(ARM_GET_SYM_BRANCH_TYPE): This and ...
(ARM_SET_SYM_BRANCH_TYPE): This in two versions depending on whether
BFD_ASSERT is defined or not.

ld/
* emultempl/armelf.em (gld${EMULATION_NAME}_finish): Use
ARM_GET_SYM_BRANCH_TYPE to get branch type of a symbol.

opcodes/
* arm-dis.c (get_sym_code_type): Use ARM_GET_SYM_BRANCH_TYPE to get
branch type of a symbol.
(print_insn): Likewise.

8 years agoAllow stubs without associated input section in ARM backend
Thomas Preud'homme [Tue, 10 May 2016 14:45:01 +0000 (15:45 +0100)]
Allow stubs without associated input section in ARM backend

2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
* bfd-in.h (elf32_arm_size_stubs): Add an output section parameter.
* bfd-in2.h: Regenerated.
* elf32-arm.c (struct elf32_arm_link_hash_table): Add an output section
parameter to add_stub_section callback.
(elf32_arm_create_or_find_stub_sec): Get output section from link_sec
and pass it down to add_stub_section.
(elf32_arm_add_stub): Set section to stub_sec if NULL before using it
for error message.
(elf32_arm_size_stubs): Add output section parameter to
add_stub_section function pointer parameter.

ld/
* emultempl/armelf.em (elf32_arm_add_stub_section): Add output_section
parameter and rename input_section parameter to after_input_section.
Append input stub section to the output section if after_input_section
is NULL.

8 years agoFactor our stub creation in ARM backend
Thomas Preud'homme [Tue, 10 May 2016 14:42:20 +0000 (15:42 +0100)]
Factor our stub creation in ARM backend

2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
* elf32-arm.c (elf32_arm_create_stub): New function.
(elf32_arm_size_stubs): Use elf32_arm_create_stub for stub creation.

8 years agoRefactor Cortex-A8 erratum workaround in preparation
Thomas Preud'homme [Tue, 10 May 2016 14:28:10 +0000 (15:28 +0100)]
Refactor Cortex-A8 erratum workaround in preparation

2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
* elf32-arm.c (enum elf32_arm_stub_type): Delete
arm_stub_a8_veneer_lwm enumerator.
(arm_stub_a8_veneer_lwm): New unsigned constant to replace
aforementioned enumerator.
(struct elf32_arm_stub_hash_entry): Delete target_addend
field and add source_value.
(struct a8_erratum_fix): Delete addend field and add target_offset.
(stub_hash_newfunc): Initialize source_value field amd remove
initialization for target_addend.
(arm_build_one_stub): Stop special casing Thumb relocations: promote
the else to being always executed, moving the
arm_stub_a8_veneer_b_cond specific code in it.  Remove
stub_entry->target_addend from points_to computation.
(cortex_a8_erratum_scan): Store in a8_erratum_fix structure the offset
to target symbol from start of section rather than the offset from the
stub address.
(elf32_arm_size_stubs): Set stub_entry's source_value and target_value
fields from struct a8_erratum_fix's offset and target_offset
respectively.
(make_branch_to_a8_stub): Rename target variable to loc.  Compute
veneered_insn_loc and loc using stub_entry's source_value.

8 years agoAdd support for ARMv8-M Mainline with DSP extension
Thomas Preud'homme [Tue, 10 May 2016 14:15:15 +0000 (15:15 +0100)]
Add support for ARMv8-M Mainline with DSP extension

2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
(elf32_arm_merge_eabi_attributes): Add merging logic for
Tag_DSP_extension.

binutils/
* readelf.c (display_arm_attribute): Add output for Tag_DSP_extension.
(arm_attr_public_tags): Define DSP_extension attribute.

gas/
* NEWS: Document ARMv8-M and ARMv8-M Security and DSP Extensions.
* config/tc-arm.c (arm_ext_dsp): New feature for Thumb DSP
instructions.
(arm_extensions): Add dsp extension for ARMv8-M Mainline.
(aeabi_set_public_attributes): Memorize the feature bits of the
architecture selected for Tag_CPU_arch.  Use it to set
Tag_DSP_extension to 1 for ARMv8-M Mainline with DSP extension.
(arm_convert_symbolic_attribute): Define Tag_DSP_extension.
* testsuite/gas/arm/arch7em-bad.d: Rename to ...
* testsuite/gas/arm/arch7em-bad-1.d: This.
* testsuite/gas/arm/arch7em-bad-2.d: New file.
* testsuite/gas/arm/arch7em-bad-3.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-1.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-2.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-3.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-4.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-5.d: Likewise.
* testsuite/gas/arm/attr-march-armv8m.main.dsp.d: Likewise.

include/
* elf/arm.h (Tag_DSP_extension): Define.

ld/
* testsuite/ld-arm/arm-elf.exp (EABI attribute merging 10 (DSP)): New
test.
* testsuite/ld-arm/attr-merge-10b-dsp.s: New file.
* testsuite/ld-arm/attr-merge-10-dsp.attr: Likewise.

8 years agoAllow extension availability to depend on several architecture bits
Thomas Preud'homme [Tue, 10 May 2016 14:06:41 +0000 (15:06 +0100)]
Allow extension availability to depend on several architecture bits

2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
* config/tc-arm.c (struct arm_option_extension_value_table): Make
allowed_archs an array with 2 entries.
(ARM_EXT_OPT): Adapt to only fill the first entry of allowed_archs.
(ARM_EXT_OPT2): New macro filling the two entries of allowed_archs.
(arm_extensions): Use separate entries in allowed_archs when several
archs are allowed to use an extension and change ARCH_ANY in
ARM_ARCH_NONE in allowed_archs.
(arm_parse_extension): Check that, for each allowed_archs entry, all
bits are set in the current architecture, ignoring ARM_ANY entries.
(s_arm_arch_extension): Likewise.

include/
* arm.h (ARM_FSET_CPU_SUBSET): Define macro.

8 years agoAdd support for ARMv8-M security extensions instructions
Thomas Preud'homme [Tue, 10 May 2016 14:01:53 +0000 (15:01 +0100)]
Add support for ARMv8-M security extensions instructions

2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
* config/tc-arm.c (arm_ext_m): Add feature bit ARM_EXT2_V8M_MAIN.
(arm_ext_v8m_main): New feature set for bit ARM_EXT2_V8M_MAIN.
(arm_ext_v8m_m_only): New feature set for instructions in ARMv8-M not
shared with a non M profile architecture.
(do_rn): New function.
(known_t32_only_insn): Check opcode against arm_ext_v8m_m_only rather
than arm_ext_v8m.
(v7m_psrs): Add ARMv8-M security extensions new special registers.
(insns): Add ARMv8-M Security Extensions instructions.
(aeabi_set_public_attributes): Use arm_ext_v8m_m_only instead of
arm_ext_v8m_m to decide the profile and the Thumb ISA.
* testsuite/gas/arm/archv8m-cmse.s: New file.
* testsuite/gas/arm/archv8m-cmse-main.s: Likewise..
* testsuite/gas/arm/archv8m-cmse-msr.s: Likewise.
* testsuite/gas/arm/any-cmse.d: Likewise.
* testsuite/gas/arm/any-cmse-main.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-base.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-msr-base.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-main-1.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-main-2.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-msr-main.d: Likewise.

include/
* opcode/arm.h (ARM_EXT2_V8M_MAIN): new feature bit.
(ARM_AEXT2_V8M_MAIN): New architecture extension feature set.
(ARM_ARCH_V8M_MAIN): Use ARM_AEXT2_V8M_MAIN instead of ARM_AEXT2_V8M
for the high core bits.

opcodes/
* arm-dis.c (coprocessor_opcodes): Add entries for VFP ARMv8-M
Mainline Security Extensions instructions.
(thumb_opcodes): Add entries for narrow ARMv8-M Security
Extensions instructions.
(thumb32_opcodes): Add entries for wide ARMv8-M Security Extensions
instructions.
(psr_name): Add new MSP_NS and PSP_NS ARMv8-M Security Extensions
special registers.

8 years agobinutils/doc: Update documentation for nm --size-sort
Andrew Burgess [Fri, 29 Apr 2016 12:22:51 +0000 (13:22 +0100)]
binutils/doc: Update documentation for nm --size-sort

The documentation for 'nm --size-sort' is out of step with the code, the
special handling for ELF is not mentioned in the documentation, and
could cause confusion to a user.

binutils/ChangeLog:

* doc/binutils.texi (nm): Update description of --size-sort.

8 years ago2016-05-10 Christophe Lyon <christophe.lyon@linaro.org>
Christophe Lyon [Tue, 10 May 2016 07:33:08 +0000 (09:33 +0200)]
2016-05-10  Christophe Lyon  <christophe.lyon@linaro.org>

* ld/testsuite/ld-elf/flags1.d (xfail): Remove *-*-nacl*".

8 years agoPR 20059 _bfd_elf_copy_link_hash_symbol_type segfault
Pip Cet [Tue, 10 May 2016 01:31:47 +0000 (11:01 +0930)]
PR 20059 _bfd_elf_copy_link_hash_symbol_type segfault

PR ld/20059
* elfxx-target.h (bfd_elfNN_bfd_copy_link_hash_symbol_type):
Define as _bfd_generic_copy_link_hash_symbol_type when using
generic hash table.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 10 May 2016 00:00:17 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoFix for PR gold/19987.
Han Shen [Fri, 6 May 2016 22:07:13 +0000 (15:07 -0700)]
Fix for PR gold/19987.

8 years agoFix seg fault objdumping a corrupt binary with an invalid sh_link field.
Nick Clifton [Mon, 9 May 2016 16:31:07 +0000 (17:31 +0100)]
Fix seg fault objdumping a corrupt binary with an invalid sh_link field.

PR binutils/20063
* elf.c (bfd_elf_get_elf_syms): Check for out of range sh_link
field before accessing sections array.

* readelf.c (get_32bit_section_headers): Warn if an out of range
sh_link or sh_info field is encountered.
(get_64bit_section_headers): Likewise.

8 years ago[ARM/STM32L4XX] PR 20030: --fix-stm32l4xx-629360 fails to create vldm/vpop veneers...
Christophe Monat [Mon, 9 May 2016 13:10:37 +0000 (15:10 +0200)]
[ARM/STM32L4XX] PR 20030: --fix-stm32l4xx-629360 fails to create vldm/vpop veneers for double-precision registers

bfd/
PR ld/20030
* elf32-arm.c (is_thumb2_vldm): Account for T1 (DP) encoding.
(stm32l4xx_need_create_replacing_stub): Rename ambiguous nb_regs
to nb_words.
(create_instruction_vldmia): Add is_dp to disambiguate SP/DP
encoding.
(create_instruction_vldmdb): Likewise.
(stm32l4xx_create_replacing_stub_vldm): is_dp detects DP encoding,
uses it to re-encode.

ld/
PR ld/20030
* testsuite/ld-arm/arm-elf.exp: Run new stm32l4xx-fix-vldm-dp
tests. Fix misnamed stm32l4xx-fix-all.
* testsuite/ld-arm/stm32l4xx-fix-vldm-dp.s: New tests for multiple
loads with DP registers.
* testsuite/ld-arm/stm32l4xx-fix-vldm-dp.d: New reference file.
* testsuite/ld-arm/stm32l4xx-fix-vldm.s: Add missing comment.
* testsuite/ld-arm/stm32l4xx-fix-all.s: Add tests for multiple
loads with DP registers.
* testsuite/ld-arm/stm32l4xx-fix-all.d: Update reference.

8 years agoRevert accidental commit.
Nick Clifton [Mon, 9 May 2016 11:07:32 +0000 (12:07 +0100)]
Revert accidental commit.

PR 19938
* elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Revert accidental
commit.

8 years agoUpdate section merge test.
Pitchumani Sivanupandi [Mon, 9 May 2016 11:04:16 +0000 (12:04 +0100)]
Update section merge test.

* testsuite/ld-elf/flags1.d (readelf): Dump section header instead
program headers.
(xfail): Remove avr-*-*.
Update regex to check the section flags.
* testsuite/ld-elf/merge.d (xfail): Remove avr-*-*.

8 years agoopcodes,gas: sparc: fix mnemonic of faligndatai
Jose E. Marchesi [Mon, 9 May 2016 11:09:53 +0000 (04:09 -0700)]
opcodes,gas: sparc: fix mnemonic of faligndatai

opcodes/ChangeLog:

2016-05-09  Jose E. Marchesi  <jose.marchesi@oracle.com>

* sparc-opc.c (sparc_opcodes): Fix mnemonic of faligndatai.

gas/ChangeLog:

2016-05-09  Jose E. Marchesi  <jose.marchesi@oracle.com>

* testsuite/gas/sparc/sparc5vis4.s: Fix mnemonic of faligndatai.
* testsuite/gas/sparc/sparc5vis4.d: Likewise.

8 years agoRegenerate configure
Alan Modra [Mon, 9 May 2016 07:54:30 +0000 (17:24 +0930)]
Regenerate configure

8 years agoFix ealphavms.c and eelf64_ia64_vms.c deps
Alan Modra [Mon, 9 May 2016 07:40:03 +0000 (17:10 +0930)]
Fix ealphavms.c and eelf64_ia64_vms.c deps

* Makefile.am (ealphavms.c, eelf64_ia64_vms): Correct .em deps.
* Makefile.in: Regenerate.

8 years agoRedundant hash table check
Alan Modra [Mon, 9 May 2016 07:38:35 +0000 (17:08 +0930)]
Redundant hash table check

* elf64-ppc.c (ppc64_elf_init_stub_bfd): Remove redundant NULL check.

8 years agoCorrect script input section pattern
Alan Modra [Mon, 9 May 2016 07:37:33 +0000 (17:07 +0930)]
Correct script input section pattern

We don't want this to match .rela.text or similar.

* testsuite/ld-scripts/pr14962-2.t: Match .text, not *.text.
* testsuite/ld-scripts/rgn-at5.t: Similarly, .sec not *.sec.
* testsuite/ld-scripts/section-match-1.t: Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 9 May 2016 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoremove trivialy unused variables
Trevor Saunders [Mon, 18 Apr 2016 17:16:27 +0000 (13:16 -0400)]
remove trivialy unused variables

gdb/ChangeLog:

2016-05-07  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* aarch64-linux-tdep.c (aarch64_linux_sigframe_init): Remove unused
variables.
* aarch64-tdep.c (aarch64_skip_prologue): Likewise.
(aarch64_scan_prologue): Likewise.
(aarch64_prologue_prev_register): Likewise.
(aarch64_dwarf2_prev_register): Likewise.
(pass_in_v): Likewise.
(aarch64_push_dummy_call): Likewise.
(aarch64_breakpoint_from_pc): Likewise.
(aarch64_return_in_memory): Likewise.
(aarch64_return_value): Likewise.
(aarch64_displaced_step_b_cond): Likewise.
(aarch64_displaced_step_cb): Likewise.
(aarch64_displaced_step_tb): Likewise.
(aarch64_gdbarch_init): Likewise.
(aarch64_process_record): Likewise.
* alpha-mdebug-tdep.c (alpha_mdebug_init_abi): Likewise.
* alpha-tdep.c (_initialize_alpha_tdep): Likewise.
* amd64-dicos-tdep.c (amd64_dicos_init_abi): Likewise.
* amd64-linux-tdep.c (amd64_dtrace_parse_probe_argument): Likewise.
* amd64-tdep.c (fixup_riprel): Likewise.
* amd64-windows-tdep.c (amd64_windows_frame_decode_epilogue): Likewise.
(amd64_windows_frame_decode_insns): Likewise.
(amd64_windows_frame_cache): Likewise.
(amd64_windows_frame_prev_register): Likewise.
(amd64_windows_frame_this_id): Likewise.
(amd64_windows_init_abi): Likewise.
* arm-linux-tdep.c (arm_linux_get_syscall_number): Likewise.
(arm_linux_get_next_pcs_syscall_next_pc): Likewise.
* arm-symbian-tdep.c (arm_symbian_init_abi): Likewise.
* arm-tdep.c (arm_make_epilogue_frame_cache): Likewise.
(arm_epilogue_frame_prev_register): Likewise.
(arm_record_vdata_transfer_insn): Likewise.
(arm_record_exreg_ld_st_insn): Likewise.
* auto-load.c (execute_script_contents): Likewise.
(print_scripts): Likewise.
* avr-tdep.c (avr_frame_prev_register): Likewise.
(avr_push_dummy_call): Likewise.
* bfin-linux-tdep.c (bfin_linux_sigframe_init): Likewise.
* bfin-tdep.c (bfin_gdbarch_init): Likewise.
* blockframe.c (find_pc_partial_function_gnu_ifunc): Likewise.
* break-catch-throw.c (fetch_probe_arguments): Likewise.
* breakpoint.c (breakpoint_xfer_memory): Likewise.
(breakpoint_init_inferior): Likewise.
(breakpoint_inserted_here_p): Likewise.
(software_breakpoint_inserted_here_p): Likewise.
(hardware_breakpoint_inserted_here_p): Likewise.
(bpstat_what): Likewise.
(break_range_command): Likewise.
(save_breakpoints): Likewise.
* coffread.c (coff_symfile_read): Likewise.
* cris-tdep.c (cris_push_dummy_call): Likewise.
(cris_scan_prologue): Likewise.
(cris_register_size): Likewise.
(_initialize_cris_tdep): Likewise.
* d-exp.y: Likewise.
* dbxread.c (dbx_read_symtab): Likewise.
(process_one_symbol): Likewise.
(coffstab_build_psymtabs): Likewise.
(elfstab_build_psymtabs): Likewise.
* dicos-tdep.c (dicos_init_abi): Likewise.
* disasm.c (do_mixed_source_and_assembly): Likewise.
(gdb_disassembly): Likewise.
* dtrace-probe.c (dtrace_process_dof): Likewise.
* dwarf2read.c (error_check_comp_unit_head): Likewise.
(build_type_psymtabs_1): Likewise.
(skip_one_die): Likewise.
(process_imported_unit_die): Likewise.
(dwarf2_physname): Likewise.
(read_file_scope): Likewise.
(setup_type_unit_groups): Likewise.
(create_dwo_cu_reader): Likewise.
(create_dwo_cu): Likewise.
(create_dwo_unit_in_dwp_v1): Likewise.
(create_dwo_unit_in_dwp_v2): Likewise.
(lookup_dwo_unit_in_dwp): Likewise.
(free_dwo_file): Likewise.
(check_producer): Likewise.
(dwarf2_add_typedef): Likewise.
(dwarf2_add_member_fn): Likewise.
(read_unsigned_leb128): Likewise.
(read_signed_leb128): Likewise.
(dwarf2_const_value): Likewise.
(follow_die_sig_1): Likewise.
(dwarf_decode_macro_bytes): Likewise.
* extension.c (restore_active_ext_lang): Likewise.
* frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise.
* ft32-tdep.c (ft32_analyze_prologue): Likewise.
* gdbtypes.c (lookup_typename): Likewise.
(resolve_dynamic_range): Likewise.
(check_typedef): Likewise.
* h8300-tdep.c (h8300_is_argument_spill): Likewise.
(h8300_gdbarch_init): Likewise.
* hppa-tdep.c (hppa32_push_dummy_call): Likewise.
(hppa_frame_this_id): Likewise.
(_initialize_hppa_tdep): Likewise.
* hppanbsd-tdep.c (hppanbsd_sigtramp_cache_init): Likewise.
* hppaobsd-tdep.c (hppaobsd_supply_fpregset): Likewise.
* i386-dicos-tdep.c (i386_dicos_init_abi): Likewise.
* i386-tdep.c (i386_bnd_type): Likewise.
(i386_gdbarch_init): Likewise.
(i386_mpx_bd_base): Likewise.
* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Likewise.
* i386obsd-tdep.c (i386obsd_elf_init_abi): Likewise.
* ia64-tdep.c (examine_prologue): Likewise.
(ia64_frame_cache): Likewise.
(ia64_push_dummy_call): Likewise.
* infcmd.c (finish_command_fsm_async_reply_reason): Likewise.
(default_print_one_register_info): Likewise.
* infrun.c (infrun_thread_ptid_changed): Likewise.
(thread_still_needs_step_over): Likewise.
(stop_all_threads): Likewise.
(restart_threads): Likewise.
(keep_going_stepped_thread): Likewise.
* iq2000-tdep.c (iq2000_scan_prologue): Likewise.
* language.c (language_init_primitive_type_symbols): Likewise.
* linespec.c (add_sal_to_sals): Likewise.
* linux-nat.c (status_callback): Likewise.
(kill_unfollowed_fork_children): Likewise.
(linux_nat_kill): Likewise.
* linux-tdep.c (linux_fill_prpsinfo): Likewise.
* linux-thread-db.c (thread_db_notice_clone): Likewise.
(record_thread): Likewise.
* location.c (string_to_event_location_basic): Likewise.
* m32c-tdep.c (m32c_prev_register): Likewise.
* m32r-linux-tdep.c (m32r_linux_init_abi): Likewise.
* m32r-tdep.c (decode_prologue): Likewise.
* m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise.
* machoread.c (macho_symtab_read): Likewise.
(macho_symfile_read): Likewise.
(macho_symfile_offsets): Likewise.
* maint.c (set_per_command_cmd): Likewise.
* mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Likewise.
(mi_cmd_stack_list_variables): Likewise.
* mi/mi-main.c (mi_cmd_exec_run): Likewise.
(output_register): Likewise.
(mi_cmd_execute): Likewise.
(mi_cmd_trace_define_variable): Likewise.
(print_variable_or_computed): Likewise.
* minsyms.c (prim_record_minimal_symbol_full): Likewise.
* mn10300-tdep.c (mn10300_frame_prev_register): Likewise.
* msp430-tdep.c (msp430_pseudo_register_write): Likewise.
* mt-tdep.c (mt_registers_info): Likewise.
* nios2-tdep.c (nios2_analyze_prologue): Likewise.
(nios2_push_dummy_call): Likewise.
(nios2_frame_unwind_cache): Likewise.
(nios2_stub_frame_cache): Likewise.
(nios2_stub_frame_sniffer): Likewise.
(nios2_gdbarch_init): Likewise.
* ppc-ravenscar-thread.c: Likewise.
* ppcfbsd-tdep.c (ppcfbsd_sigtramp_frame_cache): Likewise.
* python/py-evts.c (add_new_registry): Likewise.
* python/py-finishbreakpoint.c (bpfinishpy_init): Likewise.
(bpfinishpy_detect_out_scope_cb): Likewise.
* python/py-framefilter.c (py_print_value): Likewise.
* python/py-inferior.c (infpy_write_memory): Likewise.
* python/py-infevents.c (create_inferior_call_event_object): Likewise.
* python/py-infthread.c (thpy_get_ptid): Likewise.
* python/py-linetable.c (ltpy_get_pcs_for_line): Likewise.
(ltpy_get_all_source_lines): Likewise.
(ltpy_is_valid): Likewise.
(ltpy_iternext): Likewise.
* python/py-symtab.c (symtab_and_line_to_sal_object): Likewise.
* python/py-unwind.c (pyuw_object_attribute_to_pointer): Likewise.
(unwind_infopy_str): Likewise.
* python/py-varobj.c (py_varobj_get_iterator): Likewise.
* ravenscar-thread.c (ravenscar_inferior_created): Likewise.
* rs6000-aix-tdep.c (rs6000_push_dummy_call): Likewise.
* rs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call): Likewise.
* rs6000-tdep.c (ppc_deal_with_atomic_sequence): Likewise.
* s390-linux-tdep.c (s390_supply_tdb_regset): Likewise.
(s390_frame_prev_register): Likewise.
(s390_dwarf2_frame_init_reg): Likewise.
(s390_record_vr): Likewise.
(s390_process_record): Likewise.
* score-tdep.c (score_push_dummy_call): Likewise.
(score3_analyze_prologue): Likewise.
* sh-tdep.c (sh_extract_return_value_nofpu): Likewise.
* sh64-tdep.c (sh64_analyze_prologue): Likewise.
(sh64_push_dummy_call): Likewise.
(sh64_extract_return_value): Likewise.
(sh64_do_fp_register): Likewise.
* solib-aix.c (solib_aix_get_section_offsets): Likewise.
* solib-darwin.c (darwin_read_exec_load_addr_from_dyld): Likewise.
(darwin_solib_read_all_image_info_addr): Likewise.
* solib-dsbt.c (enable_break): Likewise.
* solib-frv.c (enable_break2): Likewise.
(frv_fdpic_find_canonical_descriptor): Likewise.
* solib-svr4.c (svr4_handle_solib_event): Likewise.
* sparc-tdep.c (sparc_skip_stack_check): Likewise.
* sparc64-linux-tdep.c (sparc64_linux_get_longjmp_target): Likewise.
* sparcobsd-tdep.c (sparc32obsd_init_abi): Likewise.
* spu-tdep.c (info_spu_dma_cmdlist): Likewise.
* stack.c (read_frame_local): Likewise.
* symfile.c (symbol_file_add_separate): Likewise.
(remove_symbol_file_command): Likewise.
* symmisc.c (maintenance_print_one_line_table): Likewise.
* symtab.c (symbol_cache_flush): Likewise.
(basic_lookup_transparent_type): Likewise.
(sort_search_symbols_remove_dups): Likewise.
* target.c (target_memory_map): Likewise.
(target_detach): Likewise.
(target_resume): Likewise.
(acquire_fileio_fd): Likewise.
(target_store_registers): Likewise.
* thread.c (print_thread_info_1): Likewise.
* tic6x-tdep.c (tic6x_analyze_prologue): Likewise.
* tilegx-linux-tdep.c (tilegx_linux_sigframe_init): Likewise.
* tilegx-tdep.c (tilegx_push_dummy_call): Likewise.
(tilegx_analyze_prologue): Likewise.
(tilegx_stack_frame_destroyed_p): Likewise.
(tilegx_frame_cache): Likewise.
* tracefile.c (trace_save): Likewise.
* tracepoint.c (encode_actions_and_make_cleanup): Likewise.
(start_tracing): Likewise.
(print_one_static_tracepoint_marker): Likewise.
* tui/tui.c (tui_enable): Likewise.
* valops.c (value_struct_elt_bitpos): Likewise.
(find_overload_match): Likewise.
(find_oload_champ): Likewise.
* value.c (value_contents_copy_raw): Likewise.
* windows-tdep.c (windows_get_tlb_type): Likewise.
* x86-linux-nat.c (x86_linux_enable_btrace): Likewise.
* xcoffread.c (record_minimal_symbol): Likewise.
(scan_xcoff_symtab): Likewise.
* xtensa-tdep.c (execute_code): Likewise.
(xtensa_gdbarch_init): Likewise.
(_initialize_xtensa_tdep): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 8 May 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 7 May 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoStrip global symbol defined in discarded section
H.J. Lu [Fri, 6 May 2016 16:46:34 +0000 (09:46 -0700)]
Strip global symbol defined in discarded section

When a global symbol is defined in COMDAT group, we shouldn't leave an
undefined symbol in symbol table when the symbol section is discarded
unless there is a reference to the symbol outside of COMDAT group.

bfd/

PR ld/17550
* elf-bfd.h (elf_link_hash_entry): Update comments for indx,
documenting that indx == -3 if symbol is defined in a discarded
section.
* elflink.c (elf_link_add_object_symbols): Set indx to -3 if
symbol is defined in a discarded section.
(elf_link_output_extsym): Strip a global symbol defined in a
discarded section.

ld/

PR ld/17550
* testsuite/ld-elf/pr17550-1.s: New file.
* testsuite/ld-elf/pr17550-2.s: Likewise.
* testsuite/ld-elf/pr17550-3.s: Likewise.
* testsuite/ld-elf/pr17550-4.s: Likewise.
* testsuite/ld-elf/pr17550a.d: Likewise.
* testsuite/ld-elf/pr17550b.d: Likewise.
* testsuite/ld-elf/pr17550c.d: Likewise.
* testsuite/ld-elf/pr17550d.d: Likewise.

8 years agoDefine elf_backend_add_symbol_hook for Intel MCU
H.J. Lu [Fri, 6 May 2016 15:28:27 +0000 (08:28 -0700)]
Define elf_backend_add_symbol_hook for Intel MCU

elf_backend_add_symbol_hook is undefined for FreeBSD.  Define it for
Intel MCU to support STB_GNU_UNIQUE for Intel MCU and NaCl.

* elf32-i386.c (elf_backend_add_symbol_hook): Defined for Intel
MCU.

8 years ago * ld/testsuite/ld-srec/srec.exp: Mark test as XFAIL for AVR.
Senthil Kumar Selvaraj [Fri, 6 May 2016 15:24:01 +0000 (16:24 +0100)]
* ld/testsuite/ld-srec/srec.exp: Mark test as XFAIL for AVR.

8 years ago[ARM][gas] Fix warnings about uninitialised uses and unused const variables
Kyrylo Tkachov [Fri, 6 May 2016 12:36:07 +0000 (13:36 +0100)]
[ARM][gas] Fix warnings about uninitialised uses and unused const variables

* config/tc-arm.c (fpu_arch_vfp_v1): Mark with ATTRIBUTE_UNUSED.
(fpu_arch_vfp_v3): Likewise.
(fpu_arch_neon_v1): Likewise.
(arm_arch_full): Likewise.
(parse_neon_el_struct_list): Initialize fields of firsttype.

8 years agoTest load conversion with symbol versioning for x86
H.J. Lu [Fri, 6 May 2016 12:28:18 +0000 (05:28 -0700)]
Test load conversion with symbol versioning for x86

* testsuite/ld-i386/i386.exp: Run load7.
* testsuite/ld-i386/load7.d: New file.
* testsuite/ld-i386/load7.map: Likewise.
* testsuite/ld-i386/load7.s: Likewise.
* testsuite/ld-x86-64/load2.d: Likewise.
* testsuite/ld-x86-64/load2.map: Likewise.
* testsuite/ld-x86-64/load2.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run load2.

8 years agoAdd support for FMLA (by element) to AArch64 sim.
Nick Clifton [Fri, 6 May 2016 09:35:33 +0000 (10:35 +0100)]
Add support for FMLA (by element) to AArch64 sim.

* simulator.c (do_FMLA_by_element): New function.
(do_vec_op2): Call it.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 6 May 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoMore setting CHECK_RELOCS_AFTER_OPEN_INPUT to yes
H.J. Lu [Thu, 5 May 2016 15:43:58 +0000 (08:43 -0700)]
More setting CHECK_RELOCS_AFTER_OPEN_INPUT to yes

* emulparams/elf_iamcu.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): New.
* emulparams/elf_k1om.sh (CHECK_RELOCS_AFTER_OPEN_INPUT):
Likewise.
* emulparams/elf_l1om.sh (CHECK_RELOCS_AFTER_OPEN_INPUT):
Likewise.

8 years agoPass --no-relax to ld in ld-x86-64/pr18591.d
H.J. Lu [Sun, 1 May 2016 21:19:03 +0000 (14:19 -0700)]
Pass --no-relax to ld in ld-x86-64/pr18591.d

Pass --no-relax to ld so that GOTPCREL relocation will be kept.

* testsuite/ld-x86-64/pr18591.d: Pass --no-relax to ld.

8 years agoFix ChangeLog entry format
Simon Marchi [Thu, 5 May 2016 13:46:06 +0000 (09:46 -0400)]
Fix ChangeLog entry format

8 years agoExtract convert_load_reloc from x86 convert_load
H.J. Lu [Thu, 5 May 2016 11:13:47 +0000 (04:13 -0700)]
Extract convert_load_reloc from x86 convert_load

* elf32-i386.c (elf_i386_convert_load): Extract the GOT load
conversion to ...
(elf_i386_convert_load_reloc): This.  New function.
* elf64-x86-64.c (elf_x86_64_convert_load): Extract the GOT load
conversion to ...
(elf_x86_64_convert_load_reloc): This.  New function.

8 years agoCache the section contents in x86 check_relocs
H.J. Lu [Thu, 5 May 2016 11:11:57 +0000 (04:11 -0700)]
Cache the section contents in x86 check_relocs

Cache the section contents in x86 check_relocs for sections without
TLS relocations.

* elf32-i386.c (elf_i386_check_tls_transition): Remove abfd.
Don't check if contents == NULL.
(elf_i386_tls_transition): Add from_relocate_section.  Check
from_relocate_section instead of contents != NULL.  Update
elf_i386_check_tls_transition call.
(elf_i386_check_relocs): Cache the section contents if
keep_memory is FALSE.  Pass FALSE as from_relocate_section to
elf_i386_tls_transition.
(elf_i386_relocate_section): Pass TRUE as from_relocate_section
to elf_i386_tls_transition.
(elf_backend_caches_rawsize): New.
* elf64-x86-64.c (elf_x86_64_check_tls_transition): Don't check
if contents == NULL.
(elf_x86_64_tls_transition): Add from_relocate_section.  Check
from_relocate_section instead of contents != NULL.
(elf_x86_64_check_relocs): Cache the section contents if
keep_memory is FALSE.  Pass FALSE as from_relocate_section to
elf_x86_64_tls_transition.
(elf_x86_64_relocate_section): Pass TRUE as from_relocate_section
to elf_x86_64_tls_transition.
(elf_backend_caches_rawsize): New.

8 years agoInitialize res in get_next_pcs_read_memory_unsigned_integer
Yao Qi [Thu, 5 May 2016 08:00:56 +0000 (09:00 +0100)]
Initialize res in get_next_pcs_read_memory_unsigned_integer

This patch initialize res to zero, otherwise, it may have some garbage
bits after the *the_target->read_memory call.

gdb/gdbserver:

2016-05-05  Yao Qi  <yao.qi@linaro.org>

* linux-arm-low.c (get_next_pcs_read_memory_unsigned_integer):
Initialize res to zero.

8 years agoChange type of cpsr in arm_sigreturn_next_pc
Yao Qi [Thu, 5 May 2016 08:00:56 +0000 (09:00 +0100)]
Change type of cpsr in arm_sigreturn_next_pc

Variable cpsr holds the value of cpsr register, which is 32-bit.  It
is better to explicitly use uint32_t.

gdb/gdbserver:

2016-05-05  Yao Qi  <yao.qi@linaro.org>

* linux-arm-low.c (arm_sigreturn_next_pc): Change type of cpsr
to uint32_t.

8 years agoPass %E to einfo when bfd_section == NULL
H.J. Lu [Thu, 5 May 2016 02:41:34 +0000 (19:41 -0700)]
Pass %E to einfo when bfd_section == NULL

Report BFD error When bfd_section == NULL in init_os.

* ldlang.c (init_os): Pass %E to einfo when bfd_section == NULL.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 5 May 2016 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years ago[spu] Fix C++ build problems
Ulrich Weigand [Wed, 4 May 2016 23:42:09 +0000 (19:42 -0400)]
[spu] Fix C++ build problems

ChangeLog:

* spu-linux-nat.c (spu_bfd_iovec_pread): Add pointer cast for C++.
(spu_bfd_open): Likewise.

gdbserver/ChangeLog:

* spu-low.c (fetch_ppc_register): Cast PowerPC-Linux-specific value
used as first ptrace argument to PTRACE_TYPE_ARG1 for C++.
(fetch_ppc_memory_1, store_ppc_memory_1): Likewise.

8 years agoLD/testsuite: Add STB_GNU_UNIQUE cross-linker test
Maciej W. Rozycki [Wed, 4 May 2016 00:46:10 +0000 (01:46 +0100)]
LD/testsuite: Add STB_GNU_UNIQUE cross-linker test

Some targets are only really, or at least regularly, regression-tested
in a crossed configuration.  Currently we only have native compiled test
cases for the STB_GNU_UNIQUE feature in the linker test suite.  This is
nice, covering run-time semantics even, but quite often not run at all.
Consequently a regression may remain unnoticed for long.

Add a simple test case then to provide basic linker coverage with no
need for a compiler or a native toolchain.

ld/
* testsuite/ld-unique/unique.d: New test.
* testsuite/ld-unique/unique.exp: Run the new test.  Adjust
messages for compiled tests.

8 years ago[ARC] Add SYNTAX_NOP and SYNTAX_1OP for extension instructions
Claudiu Zissulescu [Tue, 3 May 2016 11:44:13 +0000 (13:44 +0200)]
[ARC] Add SYNTAX_NOP and SYNTAX_1OP for extension instructions

gas/
2016-05-03  Claudiu Zissulescu  <claziss@synopsys.com>

* config/tc-arc.c (syntaxclass): Add SYNTAX_NOP and SYNTAX_1OP.
(arc_extinsn): Handle new introduced syntax.
* testsuite/gas/arc/textinsn1op.d: New file.
* testsuite/gas/arc/textinsn1op.s: Likewise.
* doc/c-arc.texi: Document SYNTAX_NOP and SYNTAX_1OP.

opcodes/
2016-05-03  Claudiu Zissulescu  <claziss@synopsys.com>

* arc-ext.c (dump_ARC_extmap): Handle SYNATX_NOP and SYNTAX_1OP.
(arcExtMap_genOpcode): Likewise.
* arc-opc.c (arg_32bit_rc): Define new variable.
(arg_32bit_u6): Likewise.
(arg_32bit_limm): Likewise.

include/
2016-05-03  Claudiu Zissulescu  <claziss@synopsys.com>

* opcode/arc.h (ARC_SYNTAX_1OP): Declare
(ARC_SYNTAX_NOP): Likewsie.
(ARC_OP1_MUST_BE_IMM): Update defined value.
(ARC_OP1_IMM_IMPLIED): Likewise.
(arg_32bit_rc, arg_32bit_u6, arg_32bit_limm): Declare.

8 years agoThrow NOT_AVAILABLE_ERROR in read_stack and read_code
Yao Qi [Wed, 4 May 2016 14:04:01 +0000 (15:04 +0100)]
Throw NOT_AVAILABLE_ERROR in read_stack and read_code

Nowadays, read_memory may throw NOT_AVAILABLE_ERROR (it is done by
patch http://sourceware.org/ml/gdb-patches/2013-08/msg00625.html)
however, read_stack and read_code still throws MEMORY_ERROR only.  This
causes PR 19947, that is prologue unwinder is unable unwind because
code memory isn't available, but MEMORY_ERROR is thrown, while unwinder
catches NOT_AVAILABLE_ERROR.

 #0  memory_error (err=err@entry=TARGET_XFER_E_IO, memaddr=memaddr@entry=140737349781158) at /home/yao/SourceCode/gnu/gdb/git/gdb/corefile.c:217
 #1  0x000000000065f5ba in read_code (memaddr=memaddr@entry=140737349781158, myaddr=myaddr@entry=0x7fffffffd7b0 "\340\023<\001", len=len@entry=1)
     at /home/yao/SourceCode/gnu/gdb/git/gdb/corefile.c:288
 #2  0x000000000065f7b5 in read_code_unsigned_integer (memaddr=memaddr@entry=140737349781158, len=len@entry=1, byte_order=byte_order@entry=BFD_ENDIAN_LITTLE)
     at /home/yao/SourceCode/gnu/gdb/git/gdb/corefile.c:363
 #3  0x00000000004717e0 in amd64_analyze_prologue (gdbarch=gdbarch@entry=0x13c13e0, pc=140737349781158, current_pc=140737349781165, cache=cache@entry=0xda0cb0)
     at /home/yao/SourceCode/gnu/gdb/git/gdb/amd64-tdep.c:2267
 #4  0x0000000000471f6d in amd64_frame_cache_1 (cache=0xda0cb0, this_frame=0xda0bf0) at /home/yao/SourceCode/gnu/gdb/git/gdb/amd64-tdep.c:2437
 #5  amd64_frame_cache (this_frame=0xda0bf0, this_cache=<optimised out>) at /home/yao/SourceCode/gnu/gdb/git/gdb/amd64-tdep.c:2508
 #6  0x000000000047214d in amd64_frame_this_id (this_frame=<optimised out>, this_cache=<optimised out>, this_id=0xda0c50)
     at /home/yao/SourceCode/gnu/gdb/git/gdb/amd64-tdep.c:2541
 #7  0x00000000006b94c4 in compute_frame_id (fi=0xda0bf0) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:481
 #8  get_prev_frame_if_no_cycle (this_frame=this_frame@entry=0xda0b20) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1809
 #9  0x00000000006bb6c9 in get_prev_frame_always_1 (this_frame=0xda0b20) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1983
 #10 get_prev_frame_always (this_frame=this_frame@entry=0xda0b20) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1999
 #11 0x00000000006bbe11 in get_prev_frame (this_frame=this_frame@entry=0xda0b20) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:2241
 #12 0x00000000006bc13c in unwind_to_current_frame (ui_out=<optimised out>, args=args@entry=0xda0b20) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1485

The fix is to let read_stack and read_code throw NOT_AVAILABLE_ERROR too,
in order to align with read_memory.

gdb:

2016-05-04  Yao Qi  <yao.qi@linaro.org>

PR gdb/19947
* corefile.c (read_memory): Rename it to ...
(read_memory_object): ... it.  Add parameter object.
(read_memory): Call read_memory_object.
(read_stack): Likewise.
(read_code): Likewise.