GDB Administrator [Mon, 9 Jan 2017 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in
Iain Buclaw [Sun, 8 Jan 2017 10:17:54 +0000 (11:17 +0100)]
[D] Fix crash when debug expression enabled.
While casting works as expected with expression debugging turned off,
this seems to be an indication that the D language parser function is
doing something wrong in the building of the expression.
Without changing the grammar, using UNOP_CAST_TYPE is the right thing to
do here, as the TypeExp handler has already wrapped the type around a
pair of OP_TYPE opcodes.
gdb/ChangeLog:
* d-exp.y (CastExpression): Emit UNOP_CAST_TYPE.
gdb/testsuite/ChangeLog:
* gdb.dlang/debug-expr.exp: New file.
GDB Administrator [Sun, 8 Jan 2017 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in
Andreas Krebbel [Thu, 5 Jan 2017 18:53:14 +0000 (19:53 +0100)]
S/390: Issue error for overflowing relocs.
Building PIE executable from non-PIC code results in broken binaries.
With this patch the problem is detected at link-time.
bfd/ChangeLog:
2017-01-07 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* elf64-s390.c (elf_s390_relocate_section): Issue error for
non-PLT relocs of shared libary symbol in exectuable.
Alan Modra [Fri, 6 Jan 2017 05:17:33 +0000 (15:47 +1030)]
[GOLD] powerpc.cc tidies
Plus some paranoia in symval_for_branch. We shouldn't get there with
dynamic symbols, but if we ever did the static_cast to Powerpc_relobj
would be wrong.
* powerpc.cc: Use shorter equivalent elfcpp typedef for
Reltype and reloc_size throughout.
(Target_powerpc::symval_for_branch): Exclude dynamic symbols.
(Target_powerpc::Scan::local): Use local var r_sym.
(Target_powerpc::Scan::global: Likewise.
(Target_powerpc::Relocate::relocate): Delete shadowing r_sym.
GDB Administrator [Sat, 7 Jan 2017 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
Yao Qi [Fri, 6 Jan 2017 14:33:01 +0000 (14:33 +0000)]
Include gdb_proc_service.h in x86-linux-nat.h
$ make check-headers CHECK_HEADERS="x86-linux-nat.h"
...
../../binutils-gdb/gdb/x86-linux-nat.h:29:8: error: 'ps_err_e' does not name a type
extern ps_err_e x86_linux_get_thread_area (pid_t pid, void *addr,
^
gdb:
2017-01-06 Yao Qi <yao.qi@linaro.org>
* x86-linux-nat.h: Include gdb_proc_service.h.
Yao Qi [Fri, 6 Jan 2017 14:33:01 +0000 (14:33 +0000)]
Include serial.h in ser-base.h.
$ make check-headers CHECK_HEADERS="ser-base.h"
...
../../binutils-gdb/gdb/ser-base.h:33:8: error: 'serial_ttystate' does not name a type
extern serial_ttystate ser_base_get_tty_state (struct serial *scb);
^
gdb:
2017-01-06 Yao Qi <yao.qi@linaro.org>
* ser-base.h: Include serial.h.
Yao Qi [Fri, 6 Jan 2017 14:33:01 +0000 (14:33 +0000)]
Include ppc-tdep.h in ppc-linux-tdep.h
$ make check-headers CHECK_HEADERS="ppc-linux-tdep.h"
...
../../binutils-gdb/gdb/ppc-linux-tdep.h:34:24: error: 'PPC_NUM_REGS' was not declared in this scope
PPC_ORIG_R3_REGNUM = PPC_NUM_REGS,
^
gdb:
2017-01-06 Yao Qi <yao.qi@linaro.org>
* ppc-linux-tdep.h: Include ppc-tdep.h.
Yao Qi [Fri, 6 Jan 2017 14:33:01 +0000 (14:33 +0000)]
Include signal.h in nat/amd64-linux-siginfo.h
$ make check-headers CHECK_HEADERS="nat/amd64-linux-siginfo.h"
....
../../binutils-gdb/gdb/nat/amd64-linux-siginfo.h:52:39: error: 'siginfo_t' was not declared in this scope
int amd64_linux_siginfo_fixup_common (siginfo_t *native, gdb_byte *inf,
^
gdb:
2017-01-06 Yao Qi <yao.qi@linaro.org>
* nat/amd64-linux-siginfo.h: Include signal.h.
Yao Qi [Fri, 6 Jan 2017 14:33:01 +0000 (14:33 +0000)]
Include break-common.h in nat/aarch64-linux-hw-point.h
$ make check-headers CHECK_HEADERS="nat/aarch64-linux-hw-point.h"
...
../../binutils-gdb/gdb/nat/aarch64-linux-hw-point.h:169:37: error: use of enum 'target_hw_bp_type' without previous declaration
int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr,
^
gdb:
2017-01-06 Yao Qi <yao.qi@linaro.org>
* nat/aarch64-linux-hw-point.h: Include break-common.h.
Yao Qi [Fri, 6 Jan 2017 14:33:00 +0000 (14:33 +0000)]
Include mi-cmds.h in mi-parse.h
$ make check-headers CHECK_HEADERS="mi/mi-parse.h"
...
../../binutils-gdb/gdb/mi/mi-parse.h:77:6: error: use of enum 'print_values' without previous declaration
enum print_values mi_parse_print_values (const char *name);
^
gdb:
2017-01-06 Yao Qi <yao.qi@linaro.org>
* mi/mi-parse.h: Include mi-cmds.h.
Yao Qi [Fri, 6 Jan 2017 14:26:45 +0000 (14:26 +0000)]
Include target.h in inf-loop.h
$ make check-headers CHECK_HEADERS="target.h inf-loop.h"
...
../../binutils-gdb/gdb/inf-loop.h:23:42: error: use of enum 'inferior_event_type' without previous declaration
extern void inferior_event_handler (enum inferior_event_type event_type,
^
gdb:
2017-01-06 Yao Qi <yao.qi@linaro.org>
* inf-loop.c: Don't include "target.h".
* inf-loop.h: Include it here.
Yao Qi [Fri, 6 Jan 2017 14:26:45 +0000 (14:26 +0000)]
Include doublest.h and expression.h in dfp.h
$ make check-headers CHECK_HEADERS="dfp.h"
...
../../binutils-gdb/gdb/dfp.h:39:8: error: 'DOUBLEST' does not name a type
extern DOUBLEST decimal_to_doublest (const gdb_byte *from, int len,
^
../../binutils-gdb/gdb/dfp.h:41:33: error: use of enum 'exp_opcode' without previous declaration
extern void decimal_binop (enum exp_opcode,
^
gdb:
2017-01-06 Yao Qi <yao.qi@linaro.org>
* dfp.h: Include "dboulest.h" and "expression.h".
Yao Qi [Fri, 6 Jan 2017 14:26:45 +0000 (14:26 +0000)]
Include ax.h in ax-gdb.h
$ make check-headers CHECK_HEADERS="ax-gdb.h"
...
../../binutils-gdb/gdb/ax-gdb.h:104:8: error: 'agent_expr_up' does not name a type
extern agent_expr_up gen_trace_for_expr (CORE_ADDR, struct expression *,
^
gdb:
2017-01-06 Yao Qi <yao.qi@linaro.org>
* ax-gdb.h: Include "ax.h"
Yao Qi [Fri, 6 Jan 2017 14:03:02 +0000 (14:03 +0000)]
Update gdb_ptrace.h in HFILES_NO_SRCDIR
Commit
e379037 (Move gdb_ptrace.h to nat/), so we should update
file name in HFILES_NO_SRCDIR too. Otherwise, 'make tags' complains,
$ make tags
make: *** No rule to make target `gdb_ptrace.h', needed by `TAGS'. Stop.
gdb:
2017-01-06 Yao Qi <yao.qi@linaro.org>
* Makefile.in (HFILES_NO_SRCDIR): Replace gdb_ptrace.h
with nat/gdb_ptrace.h.
Nick Clifton [Fri, 6 Jan 2017 12:24:54 +0000 (12:24 +0000)]
Retire Paul Brook as an ARM maintainer.
* MAINTAINERS: Move Paul Brook to the Past Maintainers section.
GDB Administrator [Fri, 6 Jan 2017 00:00:25 +0000 (00:00 +0000)]
Automatic date update in version.in
Yao Qi [Thu, 5 Jan 2017 14:44:20 +0000 (14:44 +0000)]
Fix ARI warning
This patch splits the expression before the && operator instead of
after it.
gdb:
2017-01-05 Yao Qi <yao.qi@linaro.org>
* mips-fbsd-tdep.c (mips_fbsd_sigframe_init): Move && to
new line.
(mips64_fbsd_sigframe_init): Likewise.
Nick Clifton [Thu, 5 Jan 2017 09:11:47 +0000 (09:11 +0000)]
Prevent an abort in the FRV disassembler if the target bfd name is unknown.
PR 20946
* frv-desc.c (lookup_mach_via_bfd_name): Return NULL if the name
could not be matched.
(frv_cgen_cpu_open): Allow for lookup_mach_via_bfd_name returning
NULL.
Jim Wilson [Thu, 5 Jan 2017 00:05:27 +0000 (16:05 -0800)]
Five fixes, for fcsel, fcvtz, fminnm, mls, and non-widening mul.
sim/aarch64/
* cpustate.c: Include math.h.
(aarch64_set_FP_float): Use signbit to check for signed zero.
(aarch64_set_FP_double): Likewise.
* simulator.c (do_vec_MOV_immediate, case 0x8): Add missing break.
(do_vec_mul): In all DO_VEC_WIDENING_MUL calls, make second and fourth
args same size as third arg.
(fmaxnm): Use isnan instead of fpclassify.
(fminnm, dmaxnm, dminnm): Likewise.
(do_vec_MLS): Reverse order of subtraction operands.
(dexSimpleFPCondSelect): Call aarch64_get_FP_double or
aarch64_get_FP_float to get source register contents.
(UINT_MIN, ULONG_MIN, FLOAT_UINT_MAX, FLOAT_UINT_MIN,
DOUBLE_UINT_MAX, DOUBLE_UINT_MIN, FLOAT_ULONG_MAX, FLOAT_ULONG_MIN,
DOUBLE_ULONG_MAX, DOUBLE_ULONG_MIN): New.
(do_fcvtzu): Use ULONG instead of LONG, and UINT instead of INT in
raise_exception calls.
sim/testsuite/sim/aarch64/
* fcsel.s: New.
* fcvtz.s: New.
* fminnm.s: New.
* mls.s: New.
* mul.s: New.
GDB Administrator [Thu, 5 Jan 2017 00:00:35 +0000 (00:00 +0000)]
Automatic date update in version.in
John Baldwin [Wed, 4 Jan 2017 20:15:22 +0000 (12:15 -0800)]
Use correct OSABI constant for FreeBSD/mips binaries.
gdb/ChangeLog:
* mips-fbsd-tdep.c (_initialize_mips_fbsd_tdep): Use
GDB_OSABI_FREEBSD instead of GDB_OSABI_FREEBSD_ELF.
John Baldwin [Wed, 4 Jan 2017 17:41:58 +0000 (09:41 -0800)]
Add native target for FreeBSD/mips.
This supports the o32 and n64 ABIs.
gdb/ChangeLog:
* Makefile.in (ALLDEPFILES): Add mips-fbsd-nat.c.
* NEWS: Mention new FreeBSD/mips native configuration.
* config/mips/fbsd.mh: New file.
* configure.host: Add mips*-*-freebsd*.
* mips-fbsd-nat.c: New file.
John Baldwin [Wed, 4 Jan 2017 17:41:58 +0000 (09:41 -0800)]
Add FreeBSD/mips architecture.
This has been tested for the n64 and o32 ABIs. Signal frame unwinders for
both ABIs are provided. FreeBSD/mips requires custom linkmap offsets since
it contains an additional l_off member in 'struct link_map' that other
FreeBSD platforms do not have. Support for collecting and supplying
general purpose and floating point register sets are provided. Common
routines for working with native format register sets are exported for
use by the native target.
gdb/ChangeLog:
* Makefile.in (ALL_TARGET_OBS): Add mips-fbsd-tdep.o.
(ALLDEPFILES): Add mips-fbsd-tdep.c.
* NEWS: Mention new FreeBSD/mips target.
* configure.tgt: Add mips*-*-freebsd*.
* mips-fbsd-tdep.c: New file.
* mips-fbsd-tdep.h: New file.
gdb/doc/ChangeLog:
* gdb.texinfo (Contributors): Add SRI International and University
of Cambridge for FreeBSD/mips.
Dilan Palauzov [Wed, 4 Jan 2017 16:05:22 +0000 (16:05 +0000)]
Use noyywrap option in lex files.
ld PR 20958
* ldlex.l (option): Add noyywrap
(yywrap): Delete.
* ldlex.h (yywrap): Delete prototype.
binutils
PR 20958
* syslex.l (option): Add noyywrap
(yywrap): Delete.
Jiong Wang [Wed, 4 Jan 2017 14:27:52 +0000 (14:27 +0000)]
[DWARF] Sync GCC dwarf.def change on AArch64
include/
* dwarf2.def: Sync with mainline gcc sources.
Alan Modra [Wed, 4 Jan 2017 13:19:58 +0000 (23:49 +1030)]
update-copyright.py for binutils
This is a modified form of gcc's contrib/update-copyright.py.
* update-copyright.py: New file.
* add-log.el: Update copyright year range.
* texi2pod.pl: Likewise.
Alan Modra [Wed, 4 Jan 2017 13:17:07 +0000 (23:47 +1030)]
Sync libiberty from gcc
Picks up copyright year update and other recent fixes.
Alan Modra [Sun, 18 Dec 2016 06:36:40 +0000 (17:06 +1030)]
picflag.m4 high bit set in comment
* picflag.m4: Import from gcc.
Szabolcs Nagy [Wed, 4 Jan 2017 12:27:10 +0000 (12:27 +0000)]
[AArch64] Add separate feature flag for weaker release consistent load insns
The weaker release consistency support of ARMv8.3-A is allowed as an optional
extension for ARMv8.2-A, so separate command line option and feature flag is
added: -march=armv8.2-a+rcpc turns LDAPR, LDAPRB, LDAPRH instructions on.
opcodes/
* aarch64-tbl.h (RCPC, RCPC_INSN): Define.
(aarch64_opcode_table): Use RCPC_INSN.
include/
* opcode/aarch64.h (AARCH64_FEATURE_RCPC): Define.
(AARCH64_ARCH_V8_3): Update.
gas/
* config/tc-aarch64.c (aarch64_features): Add rcpc.
* doc/c-aarch64.texi (AArch64 Extensions): Document rcpc.
* testsuite/gas/aarch64/ldst-exclusive-armv8_3.d: Rename to ...
* testsuite/gas/aarch64/ldst-rcpc.d: This.
* testsuite/gas/aarch64/ldst-exclusive-armv8_3.s: Rename to ...
* testsuite/gas/aarch64/ldst-rcpc.s: This.
* testsuite/gas/aarch64/ldst-rcpc-armv8_2.d: New test.
Norm Jacobs [Wed, 4 Jan 2017 11:49:00 +0000 (11:49 +0000)]
When configuring GAS treat as sparcv9 target the same way as a sparc64 target.
PR gas/20992
* configure.tgt: Treat sparcv9 as sparc64.
Yao Qi [Wed, 4 Jan 2017 09:32:46 +0000 (09:32 +0000)]
Fix an internal error on writing pieced value
In
ee40d8d (Move computed value's frame id to piece_closure), I only
updated read_pieced_value to use frame_id from piece_closure, but
forgot to update write_pieced_value, so it causes the following
internal error on arm-linux,
set variable l = 4^M
gdb/git/gdb/value.c:1579: internal-error: frame_id* deprecated_value_next_frame_id_hack(value*): Assertion `value->lval == lval_register' failed.^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
Quit this debugging session? (y or n) FAIL: gdb.base/store.exp: var longest l; setting l to 4 (GDB internal error)
This patch fixes the internal error.
gdb:
2017-01-04 Yao Qi <yao.qi@linaro.org>
* dwarf2loc.c (write_pieced_value): Don't use VALUE_FRAME_ID (to),
use c->frame_id when the piece location is DWARF_VALUE_REGISTER.
GDB Administrator [Wed, 4 Jan 2017 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Tue, 3 Jan 2017 22:55:54 +0000 (09:25 +1030)]
Check for shared lib support before running ld tests with -shared
Another fix now that we run these tests non-native.
* testsuite/ld-elf/audit.exp: Check for shared lib support.
* testsuite/ld-elf/compress.exp: Likewise.
* testsuite/ld-elf/dwarf.exp: Likewise.
* testsuite/ld-elf/shared.exp: Likewise.
* testsuite/ld-elf/wrap.exp: Likewise.
* testsuite/ld-ifunc/ifunc.exp: Likewise.
* testsuite/ld-plugin/lto.exp: Check $CXX exists.
James Clarke [Tue, 3 Jan 2017 16:15:15 +0000 (16:15 +0000)]
bfd: alpha: Fix crash caused by double free with --no-keep-memory
Without this, ld has been seen to crash in libc when freeing tsec_free:
*** Error in `/usr/bin/ld': double free or corruption (!prev): 0x0000000120ceb6a0 ***
_bfd_elf_link_read_relocs will always return the cached value if
present, even if keep_memory is false, therefore setting tsec_free to
NULL only when keep_memory is true is not sufficient.
* elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
if relocs are cached.
Kito Cheng [Tue, 3 Jan 2017 17:42:01 +0000 (17:42 +0000)]
Add support for the Q extension to the RISCV ISA.
gas * config/tc-riscv.c (riscv_set_arch): Whitelist the "q" ISA
extension.
(riscv_after_parse_args): Set FLOAT_ABI_QUAD when the Q ISA is
enabled and no other ABI is specified.
include * opcode/riscv-opc.h: Add support for the "q" ISA extension.
opcodes * riscv-opc.c (riscv-opcodes): Add support for the "q" ISA
extension.
* riscv-opcodes/all-opcodes: Likewise.
Rich Felker [Tue, 3 Jan 2017 16:18:41 +0000 (16:18 +0000)]
Fix generation of GOT table when only GOT-relative relocs are used.
PR ld/21017
* elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
for R_MICROBLAZE_GOTOFF_64.
Dilyan Palauzov [Tue, 3 Jan 2017 16:02:36 +0000 (16:02 +0000)]
Add fall through comment.
* riscv-dis.c (print_insn_args): Add fall through comment.
Nick Clifton [Tue, 3 Jan 2017 15:51:11 +0000 (15:51 +0000)]
Add new Serbian translation for the opcodes library.
* po/sr.po: New Serbian translation.
* configure.ac (ALL_LINGUAS): Add sr.
* configure: Regenerate.
Nick Clifton [Tue, 3 Jan 2017 15:26:27 +0000 (15:26 +0000)]
Fix compile time warning about using a possibly uninitialised variable.
Nick Clifton [Tue, 3 Jan 2017 15:17:48 +0000 (15:17 +0000)]
Sync dwarf headers with master versions in gcc repository.
* dwarf2.def: Sync with mainline gcc sources
* dwarf2.h: Likewise.
2016-12-21 Jakub Jelinek <jakub@redhat.com>
* dwarf2.def (DW_FORM_ref_sup): Renamed to ...
(DW_FORM_ref_sup4): ... this. New form.
(DW_FORM_ref_sup8): New form.
2016-10-17 Jakub Jelinek <jakub@redhat.com>
* dwarf2.h (enum dwarf_calling_convention): Add new DWARF5
calling convention codes.
(enum dwarf_line_number_content_type): New.
(enum dwarf_location_list_entry_type): Add DWARF5 DW_LLE_*
codes.
(enum dwarf_source_language): Add new DWARF5 DW_LANG_* codes.
(enum dwarf_macro_record_type): Add DWARF5 DW_MACRO_* codes.
(enum dwarf_name_index_attribute): New.
(enum dwarf_range_list_entry): New.
(enum dwarf_unit_type): New.
* dwarf2.def: Add new DWARF5 DW_TAG_*, DW_FORM_*, DW_AT_*,
DW_OP_* and DW_ATE_* entries.
2016-08-15 Jakub Jelinek <jakub@redhat.com>
* dwarf2.def (DW_AT_string_length_bit_size,
DW_AT_string_length_byte_size): New attributes.
2016-08-12 Alexandre Oliva <aoliva@redhat.com>
PR debug/63240
* dwarf2.def (DW_AT_deleted, DW_AT_defaulted): New.
* dwarf2.h (enum dwarf_defaulted_attribute): New.
Alan Modra [Tue, 3 Jan 2017 12:30:30 +0000 (23:00 +1030)]
Check ld_compile return status
* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Do not
allow test to continue after compilation errors.
(run_cc_link_tests): Likewise.
Dimitar Dimitrov [Mon, 2 Jan 2017 16:20:21 +0000 (18:20 +0200)]
Fix PRU GAS for 32-bit hosts
The PRU GAS port I originally submitted does not build on 32bit hosts.
This patch fixes it by aligning md_number_to_chars's definition with
the global declaration in tc.h.
Here is the original bug report I got:
https://github.com/rcn-ee/repos/pull/23#issuecomment-
269915175
* config/tc-pru.c (md_number_to_chars): Fix parameter to be
valueT, as declared in tc.h.
(md_apply_fix): Fix to work on 32-bit hosts.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Dimitar Dimitrov [Mon, 2 Jan 2017 16:20:20 +0000 (18:20 +0200)]
Fix PRU LD for --enable-targets=all config option
I noticed that PRU LD is broken when BFD is configured
with --enable-targets=all. This patch fixes it, and takes the
opportunity to clean the epruelf.c dependencies.
* Makefile.am (ALL_EMULATION_SOURCES): Add epruelf.c.
(epruelf.c): Remove unneeded dependencies.
* Makefile.in: Regenerate
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Alan Modra [Tue, 3 Jan 2017 01:57:19 +0000 (12:27 +1030)]
Add -rpath-link to various tests
Needed for cross-builds without --sysroot, where USE_LIBPATH isn't
set. See elf32.em after_open. Perhap ld ought to look at -rpath in
this case?
* testsuite/ld-elf/shared.exp: Add -rpath-link and -no-as-needed
to various tests.
* testsuite/ld-elfweak/elfweak.exp: Likewise.
* testsuite/ld-elfvers/vers.exp (vers19): Fix -rpath-link option.
Alan Modra [Mon, 2 Jan 2017 23:08:53 +0000 (09:38 +1030)]
Don't run C tests in ld testsuite unless we have a C compiler
Removing the [isnative] check requires that we test for a C compiler.
* testsuite/ld-elf/elf.exp: Check that $CC exists before C tests.
* testsuite/ld-pie/pie.exp: Likewise.
* testsuite/ld-plugin/lto.exp: Likewise.
GDB Administrator [Tue, 3 Jan 2017 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Mon, 2 Jan 2017 13:27:58 +0000 (23:57 +1030)]
Regen opcodes cgen files
* epiphany-desc.h: Regenerate.
* epiphany-opc.h: Regenerate.
* fr30-desc.h: Regenerate.
* fr30-opc.h: Regenerate.
* frv-desc.h: Regenerate.
* frv-opc.h: Regenerate.
* ip2k-desc.h: Regenerate.
* ip2k-opc.h: Regenerate.
* iq2000-desc.h: Regenerate.
* iq2000-opc.h: Regenerate.
* lm32-desc.h: Regenerate.
* lm32-opc.h: Regenerate.
* m32c-desc.h: Regenerate.
* m32c-opc.h: Regenerate.
* m32r-desc.h: Regenerate.
* m32r-opc.h: Regenerate.
* mep-desc.h: Regenerate.
* mep-opc.h: Regenerate.
* mt-desc.h: Regenerate.
* mt-opc.h: Regenerate.
* or1k-desc.h: Regenerate.
* or1k-opc.h: Regenerate.
* xc16x-desc.h: Regenerate.
* xc16x-opc.h: Regenerate.
* xstormy16-desc.h: Regenerate.
* xstormy16-opc.h: Regenerate.
Alan Modra [Mon, 2 Jan 2017 12:15:37 +0000 (22:45 +1030)]
Run more ld tests when not native
Many of the ld tests are not run for cross builds, in some cases
because the test needs to run a newly linked executable, and in others
simply because it was easier to write the test for native only. Even
when a test needs to run, it's good to compile and link to exercise
the linker. So that's what this patch does. I've also rid us of
the old ld_link procedure with all the HOSTING_CRT0 etc. setup. It's
much simpler to just link with $CC.
This does mean that a cross build with cross-compiler installed but
no cross C-library will give lots of failures. If that turns out to
be too annoying, I guess we can write a tcl procedure to detect it and
not run all the extra tests.
* Makefile.am (bootstrap): Delete rule.
(ld-partial, ld1, ld1-full, ld2, ld3): Likewise.
(HOSTING_CRT0, HOSTING_SCRT0): Don't define.
(HOSTING_LIBS, HOSTING_SLIBS, HOSTING_EMU): Likewise.
* configure.ac (HOSTING_CRT0, HOSTING_SCRT0): Don't define.
(HOSTING_LIBS, HOSTING_SLIBS): Likewise.
* configure.host (HOSTING_CRT0, HOSTING_LIBS): Don't define.
* Makefile.in: Regenerate.
* configure: Regenerate.
* testsuite/config/default.exp (get_link_files): Delete.
(HOSTING_CRT0, HOSTING_SCRT0, HOSTING_LIBS, HOSTING_SLIBS): Don't
define.
(ld_simple_link): Delete.
* testsuite/lib/ld-lib.exp (default_ld_link): Delete
(default_ld_simple_link): Rename to default_ld_link.
(ld_simple_link_defsyms): Rename to ld_link_defsyms.
(run_ld_link_tests): Use ld_link, not ld_simple_link.
(run_cc_link_tests): Likewise.
(run_ld_link_exec_tests): Use $CC or $CXX to link, not $ld.
Don't run exe when not native, and return unsupported.
* testsuite/ld-bootstrap/bootstrap.exp: Create gccld1 etc. dirs.
Link ld1 etc. using $CC.
* testsuite/ld-cdtest/cdtest.exp: Link cdtest using $CC.
* testsuite/ld-checks/checks.exp: Use ld_link, not ld_simple_link.
* testsuite/ld-cygwin/exe-export.exp: Likewise.
* testsuite/ld-elf/binutils.exp: Likewise.
* testsuite/ld-elf/eh-group.exp: Likewise.
* testsuite/ld-elf/exclude.exp: Likewise.
* testsuite/ld-elf/frame.exp: Likewise.
* testsuite/ld-elf/sec-to-seg.exp: Likewise.
* testsuite/ld-elf/tls_common.exp: Likewise.
* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
* testsuite/ld-fastcall/fastcall.exp: Likewise.
* testsuite/ld-gc/gc.exp: Likewise.
* testsuite/ld-ifunc/binutils.exp: Likewise.
* testsuite/ld-mep/mep.exp: Likewise.
* testsuite/ld-mips-elf/mips-elf-flags.exp: Likewise.
* testsuite/ld-mn10300/mn10300.exp: Likewise.
* testsuite/ld-nios2/nios2.exp: Likewise.
* testsuite/ld-pe/pe-compile.exp: Likewise.
* testsuite/ld-pe/pe-run.exp: Likewise.
* testsuite/ld-pe/pe-run2.exp: Likewise.
* testsuite/ld-plugin/plugin.exp: Likewise.
* testsuite/ld-scripts/align.exp: Likewise.
* testsuite/ld-scripts/alignof.exp: Likewise.
* testsuite/ld-scripts/assert.exp: Likewise.
* testsuite/ld-scripts/defined.exp: Likewise.
* testsuite/ld-scripts/extern.exp: Likewise.
* testsuite/ld-scripts/log2.exp: Likewise.
* testsuite/ld-scripts/map-address.exp: Likewise.
* testsuite/ld-scripts/phdrs.exp: Likewise.
* testsuite/ld-scripts/phdrs2.exp: Likewise.
* testsuite/ld-scripts/script.exp: Likewise.
* testsuite/ld-scripts/section-flags.exp: Likewise.
* testsuite/ld-scripts/sizeof.exp: Likewise.
* testsuite/ld-scripts/sysroot-prefix.exp: Likewise.
* testsuite/ld-scripts/weak.exp: Likewise.
* testsuite/ld-selective/selective.exp: Likewise.
* testsuite/ld-sh/sh.exp: Likewise.
* testsuite/ld-sh/sh64/relax.exp: Likewise.
* testsuite/ld-sh/sh64/relfail.exp: Likewise.
* testsuite/ld-srec/srec.exp: Likewise.
* testsuite/ld-tic6x/tic6x.exp: Likewise.
* testsuite/ld-undefined/weak-undef.exp: Likewise.
* testsuite/ld-versados/versados.exp: Likewise.
* testsuite/ld-x86-64/dwarfreloc.exp: Likewise.
* testsuite/ld-xtensa/coalesce.exp: Likewise.
* testsuite/ld-xtensa/diff_overflow.exp: Likewise.
* testsuite/ld-xtensa/lcall.exp: Likewise.
* testsuite/ld-elf/audit.exp: Run non-native too.
* testsuite/ld-elf/compress.exp: Likewise. Replace ld options with
gcc -Wl, options.
* testsuite/ld-elf/dwarf.exp: Run non-native too. Use ld_link,
not ld_simple_link. Add -Wl,--no-as-needed to some tests.
* testsuite/ld-elf/elf.exp: Run non-native too. Formatting.
* testsuite/ld-elf/indirect.exp: Run non-native too. Add
-Wl,--no-as-needed to most tests.
* testsuite/ld-elf/shared.exp: Run non-native too. Use braces
to simplify quoting. Set run_tests using [list] rather than
brace assignment to expand $extralibs. Add -Wl,--no-as-needed
to many test. Prefix ld options with -Wl,.
(mix_pic_and_non_pic): Don't run exe if not native.
* testsuite/ld-elf/wrap.exp: Run non-native too. Add
-Wl,--no-as-needed and prefix ld options with -Wl,.
* testsuite/ld-elfvers/vers.exp: Run non-native too. Use ld_link,
not ld_simple_link.
* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
(visibility_test): Don't run exe if not native.
* testsuite/ld-elfweak/elfweak.exp: Run non-native too. Use ld_link,
not ld_simple_link.
(build_exec): Don't run exe if not native.
* testsuite/ld-ifunc/ifunc.exp: Run non-native too. Use ld_link,
not ld_simple_link. Link using $CC. Add -Wl,--no-as-needed
to some tests and prefix ld options with -Wl,. Expect GNU
for hppa-linux even when no ifuncs. Delete cleanup.
* testsuite/ld-pie/pie.exp: Run non-native too.
* testsuite/ld-plugin/lto.exp: Likewise.
* testsuite/ld-shared/shared.exp: Likewise. Use ld_link,
not ld_simple_link.
(shared_test): Don't run exe if not native.
* testsuite/ld-size/size.exp: Run non-native too. Add
-Wl,--no-as-needed to some tests. Prefix ld options with -Wl,.
* testsuite/ld-unique/unique.exp: Run non-native too. Use ld_link,
not ld_simple_link. Link using $CC. Add -Wl,--no-as-needed
to some tests and prefix ld options with -Wl,. Expect GNU
for hppa-linux even when no unique syms. Delete cleanup.
* testsuite/ld-x86-64/tls.exp: Add -Wl,--no-as-needed to some
tests and prefix ld options with -Wl,.
* testsuite/ld-x86-64/x86-64.exp: Use ld_link, not ld_simple_link.
Add -Wl,--no-as-needed to some tests. Prefix ld options with -Wl,.
Alan Modra [Mon, 2 Jan 2017 12:13:15 +0000 (22:43 +1030)]
Support -z relro on metag
* emulparams/elf32metag.sh (COMMONPAGESIZE): Define.
Alan Modra [Mon, 2 Jan 2017 12:03:47 +0000 (22:33 +1030)]
Support -z relro on hppa
PR ld/21000
* emulparams/hppalinux.sh (DATA_ADDR, SHLIB_DATA_ADDR): Don't define.
(DATA_SEGMENT_ALIGN, DATA_SEGMENT_END, DATA_SEGMENT_RELRO_END): Define.
* scripttempl/elf.sc: Don't define the above if DATA_SEGMENT_ALIGN
is already defined.
Alan Modra [Mon, 2 Jan 2017 12:01:27 +0000 (22:31 +1030)]
Don't make symbols dynamic other than undef weak
Fixes: tmpdir/pr14525: symbol lookup error: tmpdir/pr14525: undefined
symbol: __executable_start
FAIL: PIE PR ld/14525
* elf32-hppa.c (ensure_undef_weak_dynamic): New function.
(allocate_plt_static, allocate_dynrelocs): Use it.
Alan Modra [Mon, 2 Jan 2017 11:58:29 +0000 (22:28 +1030)]
Set SHF_INFO_LINK for .PARISC.unwind
This flag should be set for any section header using sh_info to
point to another section.
Fixes a readelf warning about an unexpected value in info field,
resulting in FAIL: Build warn libbar.so
* elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
.PARISC.unwind section.
Alan Modra [Mon, 2 Jan 2017 11:36:28 +0000 (22:06 +1030)]
PR20989, sparc GOT sequence optimisation
PR ld/20989
* elfxx-sparc.c (gdop_relative_offset_ok): New function.
(_bfd_sparc_elf_relocate_section): Use it to validate GOT
indirect to GOT pointer relative code edit.
Alan Modra [Mon, 2 Jan 2017 03:36:43 +0000 (14:06 +1030)]
Update year range in copyright notice of all files.
Alan Modra [Mon, 2 Jan 2017 03:25:05 +0000 (13:55 +1030)]
ChangeLog rotation
GDB Administrator [Mon, 2 Jan 2017 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
Joel Brobecker [Sun, 1 Jan 2017 06:50:51 +0000 (10:50 +0400)]
update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.
gdb/ChangeLog:
Update copyright year range in all GDB files.
Joel Brobecker [Sun, 1 Jan 2017 06:39:54 +0000 (10:39 +0400)]
Rotate GDB main ChangeLog for 2017
This patch rotates the GDB main ChangeLog file as per our "Start
of New Year Procedure".
2017-01-01 Joel Brobecker <brobecker@adacore.com>
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2016.
GDB Administrator [Sun, 1 Jan 2017 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Sat, 31 Dec 2016 10:32:35 +0000 (21:02 +1030)]
Fix riscv breakage
* disassemble.c (disassembler): Add break accidentally removed
by PRU patch.
Alan Modra [Sat, 31 Dec 2016 07:55:35 +0000 (18:25 +1030)]
Create sdynrelro for elfn32 mips too
* elfn32-mips.c (elf_backend_want_dynrelro): Define.
Dimitar Dimitrov [Fri, 30 Dec 2016 10:39:49 +0000 (12:39 +0200)]
PRU LD Port
* NEWS: Mention new PRU target.
* Makefile.am: Add PRU target.
* configure.tgt: Ditto.
* emulparams/pruelf.sh: New file.
* emultempl/pruelf.em: New file.
* scripttempl/pru.sc: New file.
* Makefile.in: Regenerate.
* testsuite/ld-pru/emit-relocs-1.d: New PRU testcase file.
* testsuite/ld-pru/emit-relocs-1.ld: Ditto.
* testsuite/ld-pru/emit-relocs-1a.s: Ditto.
* testsuite/ld-pru/emit-relocs-1b.s
* testsuite/ld-pru/ldi32.d: Ditto.
* testsuite/ld-pru/ldi32.s: Ditto.
* testsuite/ld-pru/ldi32_symbol.s: Ditto.
* testsuite/ld-pru/norelax_ldi32-data.d: Ditto.
* testsuite/ld-pru/norelax_ldi32-dis.d: Ditto.
* testsuite/ld-pru/pcrel_s10.d: Ditto.
* testsuite/ld-pru/pcrel_s10.s: Ditto.
* testsuite/ld-pru/pcrel_s10_label.s: Ditto.
* testsuite/ld-pru/pcrel_u8-illegal.d: Ditto.
* testsuite/ld-pru/pcrel_u8-illegal.s: Ditto.
* testsuite/ld-pru/pcrel_u8-illegal2.d: Ditto.
* testsuite/ld-pru/pcrel_u8-illegal2.s: Ditto.
* testsuite/ld-pru/pcrel_u8-illegal3.d: Ditto.
* testsuite/ld-pru/pcrel_u8-illegal3.s: Ditto.
* testsuite/ld-pru/pcrel_u8.d: Ditto.
* testsuite/ld-pru/pcrel_u8.s: Ditto.
* testsuite/ld-pru/pcrel_u8_label.s: Ditto.
* testsuite/ld-pru/pmem.d: Ditto.
* testsuite/ld-pru/pmem.s: Ditto.
* testsuite/ld-pru/pmem_symbol.s: Ditto.
* testsuite/ld-pru/pru.exp: Ditto.
* testsuite/ld-pru/relax_ldi32-data.d: Ditto.
* testsuite/ld-pru/relax_ldi32-dis.d: Ditto.
* testsuite/ld-pru/relax_ldi32.s: Ditto.
* testsuite/ld-pru/relax_ldi32_symbol.s: Ditto.
* testsuite/ld-pru/reloc.d: Ditto.
* testsuite/ld-pru/reloc.s: Ditto.
* testsuite/ld-pru/reloc_symbol.s: Ditto.
* testsuite/ld-pru/u16.d: Ditto.
* testsuite/ld-pru/u16.s: Ditto.
* testsuite/ld-pru/u16_symbol.s: Ditto.
PRU does not export __end symbol because it is ambiguous for it.
Users are expected to use instead the section markers __text_end,
__data_end, __bss_end or __noinit_end.
* testsuite/lib/ld-lib.exp (check_shared_lib_support): No shared
libraries are supported for PRU.
(check_gc_sections_available): Mark PRU as not supported.
* testsuite/ld-elf/eh-frame-hdr.d: Disable for PRU.
* testsuite/ld-elf/endsym.d: Likewise.
* testsuite/ld-elf/group8a.d: Likewise.
* testsuite/ld-elf/group8b.d: Likewise.
* testsuite/ld-elf/group9a.d: Likewise.
* testsuite/ld-elf/group9b.d: Likewise.
* testsuite/ld-elf/merge.d: Likewise.
* testsuite/ld-elf/pr12851.d: Likewise.
* testsuite/ld-elf/pr14926.d: Likewise.
* testsuite/ld-elf/sec-to-seg.exp: Likewise.
* testsuite/ld-elf/sec64k.exp: Mark sec64k case as too big for PRU.
* testsuite/ld-srec/srec.exp (run_srec_test): Add setup for PRU.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Dimitar Dimitrov [Tue, 27 Dec 2016 20:43:38 +0000 (22:43 +0200)]
PRU GAS Port
* NEWS: Mention new PRU target.
* Makefile.am: Add PRU target.
* config/obj-elf.c: Ditto.
* configure.tgt: Ditto.
* config/tc-pru.c: New file.
* config/tc-pru.h: New file.
* doc/Makefile.am: Add documentation for PRU GAS port.
* doc/all.texi, Ditto.
* doc/as.texinfo: Ditto.
* doc/c-pru.texi: Document PRU GAS options.
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
* po/POTFILES.in: Regenerate.
* testsuite/gas/pru/alu.d: New file for PRU GAS testsuite.
* testsuite/gas/pru/alu.s: Ditto.
* testsuite/gas/pru/branch.d: Ditto.
* testsuite/gas/pru/branch.s: Ditto.
* testsuite/gas/pru/illegal.l: Ditto.
* testsuite/gas/pru/illegal.s: Ditto.
* testsuite/gas/pru/ldi.d: Ditto.
* testsuite/gas/pru/ldi.s: Ditto.
* testsuite/gas/pru/ldst.d: Ditto.
* testsuite/gas/pru/ldst.s: Ditto.
* testsuite/gas/pru/loop.d: Ditto.
* testsuite/gas/pru/loop.s: Ditto.
* testsuite/gas/pru/misc.d: Ditto.
* testsuite/gas/pru/misc.s: Ditto.
* testsuite/gas/pru/pru.exp: Ditto.
* testsuite/gas/pru/pseudo.d: Ditto.
* testsuite/gas/pru/pseudo.s: Ditto.
* testsuite/gas/pru/warn_reglabel.l: Ditto.
* testsuite/gas/pru/warn_reglabel.s: Ditto.
* testsuite/gas/pru/xfr.d: Ditto.
* testsuite/gas/pru/xfr.s: Ditto.
* testsuite/gas/lns/lns.exp: Mark lns-common-1-alt variant for PRU.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Dimitar Dimitrov [Fri, 30 Dec 2016 10:39:47 +0000 (12:39 +0200)]
PRU Binutils port
* readelf.c (guess_is_rela): Add EM_TI_PRU.
(dump_relocations): Invoke elf_pru_reloc_type.
(get_machine_name): Handle EM_TI_PRU.
(is_32bit_abs_reloc): Handle R_PRU_BFD_RELOC_32.
(is_16bit_abs_reloc): Handle R_PRU_BFD_RELOC_16.
(is_none_reloc): Handle PRU_NONE and PRU_DIFF variants.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Dimitar Dimitrov [Fri, 30 Dec 2016 10:39:50 +0000 (12:39 +0200)]
PRU Opcode Port
opcodes/
* Makefile.am: Add PRU source files.
* configure.ac: Add PRU target.
* disassemble.c (disassembler): Register PRU arch.
* pru-dis.c: New file.
* pru-opc.c: New file.
* Makefile.in: Regenerate.
* configure: Regenerate.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Dimitar Dimitrov [Fri, 30 Dec 2016 10:39:46 +0000 (12:39 +0200)]
PRU BFD support
include/
* elf/common.h: Add PRU ELF.
* elf/pru.h: New file.
* opcode/pru.h: New file.
* dis-asm.h (print_insn_pru): Declare.
bfd/
* archures.c: Add bfd_arch_pru.
* Makefile.am: Add PRU target.
* config.bfd: Ditto.
* configure.ac: Ditto.
* elf-bfd.h (enum elf_target_id): Add PRU_ELF_DATA.
* targets.c: Add pru_elf32_vec.
* reloc.c: Add PRU relocations.
* cpu-pru.c: New file.
* elf32-pru.c: New file.
* Makefile.in: Regenerate.
* configure: Regenerate.
* po/SRC-POTFILES.in: Regenerate.
* bfd-in2.h: Regenerate
* libbfd.h: Regenerate.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Dimitar Dimitrov [Fri, 30 Dec 2016 10:39:51 +0000 (12:39 +0200)]
Add PRU ELF ID to elfcpp
* elfcpp.h (enum EM): Add EM_TI_PRU.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Dimitar Dimitrov [Fri, 30 Dec 2016 10:39:59 +0000 (12:39 +0200)]
ld testsuite: Sanitize output from ld
Leading dashes from an LD error message confuse send_log, because the
string is taken to be an option.
This patch fixes the following DejaGnu error:
--defsym:1: undefined symbol `foo2' referenced in expression
failed with: <--defsym:1: undefined symbol `foo2' referenced in expression>, no expected output
ERROR: tcl error sourcing .../ld/testsuite/ld-gc/gc.exp.
ERROR: usage: send [args] string
while executing
"send_log "$comp_output\n""
(procedure "run_dump_test" line 376)
* testsuite/lib/ld-lib.exp (run_dump_test): Pass -- to send_log.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Alan Modra [Fri, 30 Dec 2016 05:57:54 +0000 (16:27 +1030)]
Import config.sub
* config.sub: Import from upstream.
GDB Administrator [Sat, 31 Dec 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Fri, 30 Dec 2016 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in
Yao Qi [Thu, 29 Dec 2016 15:47:40 +0000 (15:47 +0000)]
Return 'int' rather than 'unsigned short' in avrdis_opcode
avrdis_opcode return type is unsigned short, but -1 at the end of
this function is returned. Additionally, print_insn_avr doesn't
handle when -1 (in case of memory error) is returned from
avrdis_opcode.
This patch changes avrdis_opcode returning int indicating the error,
and adds a new argument for instruction we got on success. The
opcode is 16-bit, so I change local variables type to uint16_t,
and include "bfd_stdint.h" as a result. On memory error,
print_insn_avr returns -1, which is a common convention among most
of print_insn_$ARCH functions.
opcodes:
2016-12-29 Yao Qi <yao.qi@linaro.org>
* avr-dis.c: Include "bfd_stdint.h"
(avrdis_opcode): Change return type to int, add argument
insn. Set *INSN on success.
(print_insn_avr): Check return value of avrdis_opcode, and
return -1 on error.
Alan Modra [Thu, 29 Dec 2016 12:19:41 +0000 (22:49 +1030)]
link_hash_copy_indirect and symbol flags
A while ago HJ fixed PR ld/18720 with commit
6e33951ed, which, among
other things, modified _bfd_elf_link_hash_copy_indirect to not copy
ref_dynamic, ref_regular, ref_regular_nonweak, non_got_ref, needs_plt
and pointer_equality_needed when setting up an indirect non-versioned
symbol pointing to a non-default versioned symbol. I didn't notice at
the time, but the pr18720 testcase fails on hppa-linux with
"internal error, aborting at binutils-gdb-2.28/bfd/elf32-hppa.c:3933
in elf32_hppa_relocate_section".
Now hppa-linux creates entries in the plt even for local functions, if
they are referenced using plabel (function pointer) relocations. So
needs_plt is set for foo when processing pr18720a.o. When the aliases
in pr28720b.o are processed, we get an indirection from foo to
foo@FOO, but don't copy needs_plt. Since foo@FOO is the "real" symbol
that is used after that point, no plt entry is made for foo and we
bomb when relocating the plabel.
As shown by the hppa-linux scenario, needs_plt should be copied even
for non-default versioned symbols. I believe all of the others ought
to be copied too, with the exception of ref_dynamic. Not copying
ref_dynamic is right because if a shared lib references "foo" it
should not be satisfied by any non-default version "foo@FOO".
* elflink.c (_bfd_elf_link_hash_copy_indirect): Only omit
copying one flag, ref_dynamic, when versioned_hidden.
* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
* elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Use same
logic for copying weakdef flags. Copy plabel flag and merge
tls_type.
* elf32-i386.c (elf_i386_copy_indirect_symbol): Use same logic
for copying weakdef flags.
* elf32-ppc.c (ppc_elf_copy_indirect_symbol): Likewise.
* elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
* elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
* elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
* elfnn-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
* elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Likewise.
Simplify.
GDB Administrator [Thu, 29 Dec 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
Andreas Schwab [Wed, 28 Dec 2016 17:28:22 +0000 (18:28 +0100)]
Fix comment typo
* copy-relocs.h: Fix comment typo.
Cary Coutant [Wed, 28 Dec 2016 16:29:43 +0000 (08:29 -0800)]
Add explicit instantiations for build_compressed_section_map().
gold/
PR gold/20996
* object.cc (build_compressed_section_map): Add explicit instantiations.
Cary Coutant [Wed, 28 Dec 2016 16:22:59 +0000 (08:22 -0800)]
Fix last ChangeLog entry.
* copy-relocs.cc (Copy_relocs::make_copy_reloc): Use .data.rel.ro for
read-only data when linking with -z relro.
Alan Modra [Wed, 28 Dec 2016 11:29:34 +0000 (21:59 +1030)]
Check bfd support for bfd_mips_elf_get_abiflags in mips make rule
The previous scheme with a dependency in opcodes on libbfd.la
broke "make distclean".
* configure.ac: Revert 2016-12-23.
* Makefile.am: Likewise.
(MIPS_DEFS): Define.
(mips-dis.lo): Add rule.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* config.in: Regenerate.
* configure: Regenerate.
Alan Modra [Wed, 28 Dec 2016 06:34:15 +0000 (17:04 +1030)]
Use dynrelro for symbols in relro sections too
PR ld/20995
bfd/
* elflink.c (elf_link_add_object_symbols): Mark relro sections
in dynamic objects SEC_READONLY.
ld/
* testsuite/ld-elf/pr20995c.s: New test file.
* testsuite/ld-elf/pr20995-2so.r: Likewise.
* testsuite/ld-elf/elf.exp: Run it.
Cary Coutant [Wed, 28 Dec 2016 04:50:47 +0000 (20:50 -0800)]
Place copy relocations in .dynbss when target is read-only.
gold/
PR ld/20995
* copy-relocs.cc (Copy_relocs::make_copy_reloc): Use .dynbss for
read-only data when linking with -z relro.
* copy-relocs.h (Copy_relocs::dynrelro_): New data member.
* testsuite/Makefile.am (copy_test_relro): New test case.
* testsuite/Makefile.in: Regenerate.
* testsuite/copy_test_relro.cc: New source file.
* testsuite/copy_test_relro_1.cc: New source file.
GDB Administrator [Wed, 28 Dec 2016 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Tue, 27 Dec 2016 00:00:23 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Sun, 25 Dec 2016 14:00:45 +0000 (00:30 +1030)]
dynrelro section for read-only dynamic symbols copied into executable
Variables defined in shared libraries are copied into an executable's
.bss section when code in the executable is non-PIC and thus would
require dynamic text relocations to access the variable directly in
the shared library. Recent x86 toolchains also copy variables into
the executable to gain a small speed improvement.
The problem is that if the variable was originally read-only, the copy
in .bss is writable, potentially opening a security hole. This patch
cures that problem by putting the copy in a section that becomes
read-only after ld.so relocation, provided -z relro is in force.
The patch also fixes a microblaze linker segfault on attempting to
use dynamic bss variables.
bfd/
PR ld/20995
* elf-bfd.h (struct elf_link_hash_table): Add sdynrelro and
sreldynrelro.
(struct elf_backend_data): Add want_dynrelro.
* elfxx-target.h (elf_backend_want_dynrelro): Define.
(elfNN_bed): Update initializer.
* elflink.c (_bfd_elf_create_dynamic_sections): Create
sdynrelro and sreldynrelro sections.
* elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Place variables
copied into the executable from read-only sections into sdynrelro.
(elf32_arm_size_dynamic_sections): Handle sdynrelro.
(elf32_arm_finish_dynamic_symbol): Select sreldynrelro for
dynamic relocs in sdynrelro.
(elf_backend_want_dynrelro): Define.
* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol)
(elf32_hppa_size_dynamic_sections, elf32_hppa_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elf32-i386.c (elf_i386_adjust_dynamic_symbol)
(elf_i386_size_dynamic_sections, elf_i386_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elf32-metag.c (elf_metag_adjust_dynamic_symbol)
(elf_metag_size_dynamic_sections, elf_metag_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol)
(microblaze_elf_size_dynamic_sections)
(microblaze_elf_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elf32-nios2.c (nios2_elf32_finish_dynamic_symbol)
(nios2_elf32_adjust_dynamic_symbol)
(nios2_elf32_size_dynamic_sections)
(elf_backend_want_dynrelro): As above.
* elf32-or1k.c (or1k_elf_finish_dynamic_symbol)
(or1k_elf_adjust_dynamic_symbol, or1k_elf_size_dynamic_sections)
(elf_backend_want_dynrelro): As above.
* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol)
(ppc_elf_size_dynamic_sections, ppc_elf_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elf32-s390.c (elf_s390_adjust_dynamic_symbol)
(elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol)
(elf32_tic6x_size_dynamic_sections)
(elf32_tic6x_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elf32-tilepro.c (tilepro_elf_adjust_dynamic_symbol)
(tilepro_elf_size_dynamic_sections)
(tilepro_elf_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol)
(ppc64_elf_size_dynamic_sections, ppc64_elf_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elf64-s390.c (elf_s390_adjust_dynamic_symbol)
(elf_s390_size_dynamic_sections, elf_s390_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol)
(elf_x86_64_size_dynamic_sections)
(elf_x86_64_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol)
(elfNN_aarch64_size_dynamic_sections)
(elfNN_aarch64_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol)
(riscv_elf_size_dynamic_sections, riscv_elf_finish_dynamic_symbol)
(elf_backend_want_dynrelro): As above.
* elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol)
(_bfd_mips_elf_size_dynamic_sections)
(_bfd_mips_vxworks_finish_dynamic_symbol): As above.
* elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol)
(_bfd_sparc_elf_size_dynamic_sections)
(_bfd_sparc_elf_finish_dynamic_symbol): As above.
* elfxx-tilegx.c (tilegx_elf_adjust_dynamic_symbol)
(tilegx_elf_size_dynamic_sections)
(tilegx_elf_finish_dynamic_symbol): As above.
* elf32-mips.c (elf_backend_want_dynrelro): Define.
* elf64-mips.c (elf_backend_want_dynrelro): Define.
* elf32-sparc.c (elf_backend_want_dynrelro): Define.
* elf64-sparc.c (elf_backend_want_dynrelro): Define.
* elf32-tilegx.c (elf_backend_want_dynrelro): Define.
* elf64-tilegx.c (elf_backend_want_dynrelro): Define.
* elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol): Tidy.
(microblaze_elf_size_dynamic_sections): Handle sdynbss.
* elf32-nios2.c (nios2_elf32_size_dynamic_sections): Make use
of linker shortcuts to dynamic sections rather than comparing
names. Correctly set "got" flag.
ld/
PR ld/20995
* testsuite/ld-arm/farcall-mixed-app-v5.d: Update to suit changed
stub hash table traversal caused by section id increment. Accept
the previous output too.
* testsuite/ld-arm/farcall-mixed-app.d: Likewise.
* testsuite/ld-arm/farcall-mixed-lib-v4t.d: Likewise.
* testsuite/ld-arm/farcall-mixed-lib.d: Likewise.
* testsuite/ld-elf/pr20995a.s, * testsuite/ld-elf/pr20995b.s,
* testsuite/ld-elf/pr20995.r: New test.
* testsuite/ld-elf/elf.exp: Run it.
Alan Modra [Sun, 25 Dec 2016 13:51:06 +0000 (00:21 +1030)]
Put .dynbss and .rel.bss shortcuts in main elf hash table
Also, create .rel{,a}.bss for PIEs on all targets, not just x86.
* elf-bfd.h (struct elf_link_hash_table): Add sdynbss and srelbss.
* elflink.c (_bfd_elf_create_dynamic_sections): Set them. Create
.rel.bss/.rela.bss for executables, both PIE and non-PIE.
* elf32-arc.c (struct elf_arc_link_hash_table): Delete srelbss.
Use ELF hash table var throughout.
* elf32-arm.c (struct elf32_arm_link_hash_table): Delete sdynbss
and srelbss. Use ELF hash table vars throughout.
* elf32-hppa.c (struct elf32_hppa_link_hash_table): Likewise.
* elf32-i386.c (struct elf_i386_link_hash_table): Likewise.
* elf32-metag.c (struct elf_metag_link_hash_table): Likewise.
* elf32-microblaze.c (struct elf32_mb_link_hash_table): Likewise.
* elf32-nios2.c (struct elf32_nios2_link_hash_table): Likewise.
* elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise.
* elf32-ppc.c (struct ppc_elf_link_hash_table): Likewise.
* elf32-s390.c (struct elf_s390_link_hash_table): Likewise.
* elf32-tic6x.c (struct elf32_tic6x_link_hash_table): Likewise.
* elf32-tilepro.c (struct tilepro_elf_link_hash_table): Likewise.
* elf64-ppc.c (struct ppc_link_hash_table): Likewise.
* elf64-s390.c (struct elf_s390_link_hash_table): Likewise.
* elf64-x86-64.c (struct elf_x86_64_link_hash_table): Likewise.
* elfnn-aarch64.c (struct elf_aarch64_link_hash_table): Likewise.
* elfnn-riscv.c (struct riscv_elf_link_hash_table): Likewise.
* elfxx-mips.c (struct mips_elf_link_hash_table): Likewise.
* elfxx-sparc.h (struct _bfd_sparc_elf_link_hash_table): Likewise.
* elfxx-sparc.c: Likewise.
* elfxx-tilegx.c (struct tilegx_elf_link_hash_table): Likewise.
* elf32-arc.c (arc_elf_create_dynamic_sections): Delete.
(elf_backend_create_dynamic_sections): Use base ELF version.
* elf32-microblaze.c (microblaze_elf_create_dynamic_sections): Delete.
(elf_backend_create_dynamic_sections): Use base ELF version.
* elf32-or1k.c (or1k_elf_create_dynamic_sections): Delete.
(elf_backend_create_dynamic_sections): Use base ELF version.
* elf32-s390.c (elf_s390_create_dynamic_sections): Delete.
(elf_backend_create_dynamic_sections): Use base ELF version.
* elf64-ppc.c (ppc64_elf_create_dynamic_sections): Delete.
(elf_backend_create_dynamic_sections): Use base ELF version.
* elf64-s390.c (elf_s390_create_dynamic_sections): Delete.
(elf_backend_create_dynamic_sections): Use base ELF version.
* elf32-tilepro.c (tilepro_elf_create_dynamic_sections): Remove
extraneous tests.
* elfnn-aarch64.c (elfNN_aarch64_create_dynamic_sections): Likewise.
* elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Likewise.
* elfxx-tilegx.c (tilegx_elf_create_dynamic_sections): Likewise.
* elf32-i386.c (elf_i386_create_dynamic_sections): Don't create
".rel.bss" for executables.
* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Don't create
".rela.bss" for executables.
* elf32-nios2.c (nios2_elf32_create_dynamic_sections): Don't
ignore return status from _bfd_elf_create_dynamic_sections.
Alan Modra [Sun, 25 Dec 2016 23:10:58 +0000 (09:40 +1030)]
Correct .dynbss in script
The only target that renames .bss is tic6x, turning .bss into .far,
and .sbss into .bss. .dynbss is not renamed to .dynfar by BFD.
* scripttempl/elf.sc: Don't use $BSS_NAME in .dynbss.
GDB Administrator [Mon, 26 Dec 2016 00:00:32 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 25 Dec 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sat, 24 Dec 2016 00:00:18 +0000 (00:00 +0000)]
Automatic date update in version.in
Maciej W. Rozycki [Fri, 23 Dec 2016 20:03:36 +0000 (20:03 +0000)]
MIPS/BFD: Remove EI_ABIVERSION 5 allocation for PT_GNU_STACK support
Revert commit
17733f5be961 ("Increment the ABIVERSION to 5 for MIPS
objects with non-executable stacks.") and remove EI_ABIVERSION 5
allocation for PT_GNU_STACK support, which has not made it to glibc
and will be reassigned.
bfd/
* bfd/elfxx-mips.c (_bfd_mips_post_process_headers): Revert
2016-02-23 change and remove EI_ABIVERSION 5 support.
Maciej W. Rozycki [Fri, 23 Dec 2016 19:40:51 +0000 (19:40 +0000)]
MIPS16: Add ASMACRO instruction support
Add ASMACRO instruction support as per the MIPS16e ASE architecture
specifications [1][2], completing MIPS16e instruction set support.
[1] "MIPS32 Architecture for Programmers, Volume IV-a: The MIPS16e
Application-Specific Extension to the MIPS32 Architecture", MIPS
Technologies, Inc., Document Number: MD00076, Revision 2.63, July
16, 2013, Section 4.1 "MIPS16e Instruction Descriptions", p. 65
[2] "MIPS64 Architecture for Programmers, Volume IV-a: The MIPS16e
Application-Specific Extension to the MIPS64 Architecture", MIPS
Technologies, Inc., Document Number: MD00077, Revision 2.60, June
25, 2008, Section 1.1 "MIPS16e Instruction Descriptions", p. 66
include/
* opcode/mips.h: Document `0', `1', `2', `3', `4' and `s'
operand codes.
opcodes/
* mips16-opc.c (decode_mips16_operand): Add `0', `1', `2', `3',
`4' and `s' operand codes.
(mips16_opcodes): Add "asmacro" entry.
binutils/
* testsuite/binutils-all/mips/mips16-extend-insn.d: Update for
ASMACRO support.
gas/
* testsuite/gas/mips/mips16-asmacro.d: New test.
* testsuite/gas/mips/mips16-32@mips16-asmacro.d: New test.
* testsuite/gas/mips/mips16-64@mips16-asmacro.d: New test.
* testsuite/gas/mips/mips16-asmacro.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.
Maciej W. Rozycki [Fri, 23 Dec 2016 19:40:09 +0000 (19:40 +0000)]
MIPS16: Simplify extended operand handling
Simplify extended operand handling and only specially process immediates
which require bit shuffling, using the generic operand insertion and
extraction handlers for the '<' (5-bit shift amount) operand code in
particular. Require the least significant bit of all extended operand
forms to be (artificially) set to 0 for their special processing to
trigger.
gas/
* config/tc-mips.c (mips16_immed): Limit `mips16_immed_extend'
use to operands whose LSB position is zero.
opcodes/
* mips-dis.c (print_mips16_insn_arg): Simplify processing of
extended operands.
* mips16-opc.c (decode_mips16_operand): Switch the extended
form of the `<' operand type to LSB position 22.
Maciej W. Rozycki [Fri, 23 Dec 2016 18:06:55 +0000 (18:06 +0000)]
MIPS16/GAS: Clean up invalid unextended operand handling
Bail out right away when an unextended instruction encoding is required
either with the use of a `.t' suffix or by means of `.set noautoextend',
however an operand supplied requires the extended instruction form to be
used.
This is to avoid messing up with the internal state of the assembler,
even though no actual failures are known to happen as a result. Add
test cases for the situation concerned.
gas/
* config/tc-mips.c (match_mips16_insn): Don't update
`forced_insn_length' or the instruction opcode if an operand
requires an extended instruction form, but an unextended one
has been requested.
* testsuite/gas/mips/mips16-relax-unextended-1.d: New test.
* testsuite/gas/mips/mips16-relax-unextended-2.d: New test.
* testsuite/gas/mips/mips16-relax-unextended-1.l: New stderr
output.
* testsuite/gas/mips/mips16-relax-unextended-2.l: New stderr
output.
* testsuite/gas/mips/mips16-relax-unextended-1.s: New test
source.
* testsuite/gas/mips/mips16-relax-unextended-2.s: New test
source.
* testsuite/gas/mips/mips.exp: Run the new tests.
Maciej W. Rozycki [Fri, 23 Dec 2016 17:05:01 +0000 (17:05 +0000)]
MIPS16: Reassign `0' and `4' operand codes
Replace `0' and `4' operand codes with `.' and `F' respectively to free
up the `0'-`4' consecutive range. No functional change.
gas/
* config/tc-mips.c (mips16_macro_build): Replace `0' and `4'
operand codes with `.' and `F' respectively.
(mips16_macro): Likewise.
include/
* opcode/mips.h: Replace `0' and `4' operand codes with `.' and
`F' respectively.
opcodes/
* mips16-opc.c (decode_mips16_operand): Replace `0' and `4'
operand codes with `.' and `F' respectively.
(mips16_opcodes): Likewise.
Maciej W. Rozycki [Fri, 23 Dec 2016 16:49:42 +0000 (16:49 +0000)]
MIPS16: Handle non-extensible instructions correctly
Identify non-extensible instructions in the MIPS16 opcode table and
disallow their use with the `.e' instruction size suffix in assembly and
do not interpret any EXTEND prefix present as a part of the instruction
in disassembly.
According to all versions of the MIPS16 ASE specifications the following
instructions encodings are not extensible [1][2][3][4][5][6]: I8/MOV32R,
I8/MOVR32, all RRR minor opcodes, all RR minor opcodes except from DSRA
and DSRL, and EXTEND itself, and as from revision 2.50 of the MIPS16e
ASE specifications it has been further clarified what was previously
implied, that non-extesiable instructions when preceded with an EXTEND
prefix must cause a Reserved Instruction exception [3][5].
Therefore in the presence of an EXTEND prefix none of these instructions
are supposed to be handled as extended instructions and supporting these
forms in disassembly causes confusion, and in the case of the RRR major
opcode it also clashes with the ASMACRO encoding.
References:
[1] "Product Description, MIPS16 Application-Specific Extension",
Version 1.3, MIPS Technologies, Inc., 970130, Table 3. "MIPS16
Instruction Set Summary", p. 5
[2] same, Table 5 "RR Minor Opcodes (RR-type instructions)", p.10
[3] "MIPS32 Architecture for Programmers, Volume IV-a: The MIPS16e
Application-Specific Extension to the MIPS32 Architecture", MIPS
Technologies, Inc., Document Number: MD00076, Revision 2.63, July
16, 2013, Section 3.9 "MIPS16e Instruction Summaries", pp. 37-39
[4] same, Section 3.15 "Instruction Bit Encoding", pp. 46-49
[5] "MIPS64 Architecture for Programmers, Volume IV-a: The MIPS16e
Application-Specific Extension to the MIPS64 Architecture", MIPS
Technologies, Inc., Document Number: MD00077, Revision 2.60, June
25, 2008, Section 1.9 "MIPS16e Instruction Summaries", pp. 38-41
[6] same, Section 1.15 "Instruction Bit Encoding", pp. 48-51
include/
* opcode/mips.h (INSN2_SHORT_ONLY): New macro.
gas/
* config/tc-mips.c (is_size_valid_16): Disallow a `.e' suffix
instruction size override for INSN2_SHORT_ONLY opcode table
entries.
* testsuite/gas/mips/mips16-extend-swap.d: Adjust output.
* testsuite/gas/mips/mips16-macro-e.l: Adjust error messages.
* testsuite/gas/mips/mips16-32@mips16-macro-e.l: Adjust error
messages.
* testsuite/gas/mips/mips16e-32@mips16-macro-e.l: Adjust error
messages.
* testsuite/gas/mips/mips16-insn-e.d: New test.
* testsuite/gas/mips/mips16-insn-t.d: New test.
* testsuite/gas/mips/mips16-32@mips16-insn-e.d: New test.
* testsuite/gas/mips/mips16-64@mips16-insn-e.d: New test.
* testsuite/gas/mips/mips16e-32@mips16-insn-e.d: New test.
* testsuite/gas/mips/mips16-32@mips16-insn-t.d: New test.
* testsuite/gas/mips/mips16-64@mips16-insn-t.d: New test.
* testsuite/gas/mips/mips16e-32@mips16-insn-t.d: New test.
* testsuite/gas/mips/mips16-insn-e.l: New stderr output.
* testsuite/gas/mips/mips16-insn-t.l: New stderr output.
* testsuite/gas/mips/mips16-32@mips16-insn-e.l: New stderr
output.
* testsuite/gas/mips/mips16-64@mips16-insn-e.l: New stderr
output.
* testsuite/gas/mips/mips16e-32@mips16-insn-e.l: New stderr
output.
* testsuite/gas/mips/mips16-32@mips16-insn-t.l: New stderr
output.
* testsuite/gas/mips/mips16-64@mips16-insn-t.l: New stderr
output.
* testsuite/gas/mips/mips16e-32@mips16-insn-t.l: New stderr
output.
* testsuite/gas/mips/mips16-insn-e.s: New test source.
* testsuite/gas/mips/mips16-insn-t.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.
opcodes/
* mips-dis.c (print_insn_mips16): Disallow EXTEND prefix
matching for INSN2_SHORT_ONLY opcode table entries.
* mips16-opc.c (SH): New macro.
(mips16_opcodes): Set SH in `pinfo2' for non-extensible
instruction entries: "nop", "addu", "and", "break", "cmp",
"daddu", "ddiv", "ddivu", "div", "divu", "dmult", "dmultu",
"drem", "dremu", "dsllv", "dsll", "dsrav", "dsra", "dsrlv",
"dsrl", "dsubu", "exit", "entry", "jalr", "jal", "jr", "j",
"jalrc", "jrc", "mfhi", "mflo", "move", "mult", "multu", "neg",
"not", "or", "rem", "remu", "sllv", "sll", "slt", "sltu",
"srav", "sra", "srlv", "srl", "subu", "xor", "sdbbp", "seb",
"seh", "sew", "zeb", "zeh", "zew" and "extend".
binutils/
* testsuite/binutils-all/mips/mips16-extend-insn.d: New test.
* testsuite/binutils-all/mips/mips16-extend-insn.s: New test
source.
* testsuite/binutils-all/mips/mips.exp: Run the new tests.
Maciej W. Rozycki [Fri, 23 Dec 2016 12:42:56 +0000 (12:42 +0000)]
MIPS16: Remove "extended" BREAK/SDBBP handling
Remove special casing for the `6' operand code used for the embedded
trap code of the BREAK and the SDBBP instructions to support supposedly
extended forms of these instructions.
According to all versions of the MIPS16 ASE specifications these
instructions are not extensible [1][2][3][4][5][7][8][10][11], and as
from revision 2.50 of the MIPS16e ASE specifications it has been further
clarified what was previously implied, that non-extesiable instructions
when preceded with an EXTEND prefix must cause a Reserved Instruction
exception [5][6][9][10].
Therefore supposedly extended BREAK and SDBBP instructions do not serve
their purpose anymore as they do not cause a Bp and a Debug exception
respectively and supporting these forms in disassembly only causes
confusion.
References:
[1] "Product Description, MIPS16 Application-Specific Extension",
Version 1.3, MIPS Technologies, Inc., 970130, Table 3. "MIPS16
Instruction Set Summary", p. 5
[2] same, Table 5 "RR Minor Opcodes (RR-type instructions)", p.10
[3] same, Table 18. "Extendable MIPS16 Instructions", p. 24
[4] "MIPS32 Architecture for Programmers, Volume IV-a: The MIPS16e
Application-Specific Extension to the MIPS32 Architecture", MIPS
Technologies, Inc., Document Number: MD00076, Revision 2.63, July
16, 2013, Table 3.8 "MIPS16e Special Instructions", p. 38
[5] same, Section 3.11 "MIPS16e Extensible Instructions, p. 41
[6] same, Table 3.15 "MIPS16e Extensible Instructions", p. 41
[7] same, Table 3.24 "MIPS16e RR Encoding of the Funct Field", p. 49
[8] "MIPS64 Architecture for Programmers, Volume IV-a: The MIPS16e
Application-Specific Extension to the MIPS64 Architecture", MIPS
Technologies, Inc., Document Number: MD00077, Revision 2.60, June
25, 2008, Table 1.8 "MIPS16e Special Instructions", p. 39
[9] same, Section 1.11 "MIPS16e Extensible Instructions", p. 42
[10] same, Table 1.15 "MIPS16e Extensible Instructions", pp. 42-43
[11] same, Table 1.24 "MIPS16e RR Encoding of the Funct Field", p. 50
gas/
* config/tc-mips.c (match_mips16_insn): Remove the `6' operand
code special case and its associated comment.
opcodes/
* mips16-opc.c (decode_mips16_operand) <'6'>: Remove extended
encoding support.
Maciej W. Rozycki [Fri, 23 Dec 2016 12:38:35 +0000 (12:38 +0000)]
MIPS16/GAS: Fix forced size suffixes with argumentless instructions
Correct the handling of `.e' and `.t' instruction size suffixes with
instruction mnemonics which are not followed by any text on the same
line, such as arguments or white space, e.g.:
$ cat test.s
.set mips16
foo:
entry.t # comment
entry.t
exit.t # comment
exit.t
nop.t # comment
nop.t
$ as -32 -o test.o test.s
test.s: Assembler messages:
test.s:4: Error: unrecognized opcode `entry.t'
test.s:6: Error: unrecognized opcode `exit.t'
test.s:8: Error: unrecognized opcode `nop.t'
$
gas/
* config/tc-mips.c (mips16_ip): Handle `.e' and `.t' instruction
suffixes followed by a null character rather than a space too.
* testsuite/gas/mips/mips16-insn-length-noargs.d: New test.
* testsuite/gas/mips/mips16-insn-length-noargs.s: New test
source.
* testsuite/gas/mips/mips.exp: Run the new test.
Maciej W. Rozycki [Fri, 23 Dec 2016 12:37:40 +0000 (12:37 +0000)]
MIPS16/GAS: Disallow EXTEND delay-slot scheduling
Do not allow any explicitly coded EXTEND instruction to be automatically
scheduled into a jump delay slot, as an EXTEND prefix is coupled with
the next regular MIPS16 instruction and therefore swapping it with a
jump would change program's semantics; EXTEND is not architecturally
allowed to be present in a jump delay slot anyway.
opcodes/
* mips16-opc.c (mips16_opcodes): Set NODS in `pinfo' for
"extend".
gas/
* testsuite/gas/mips/mips16-extend-swap.d: New test.
* testsuite/gas/mips/mips16-extend-swap.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new test.
Maciej W. Rozycki [Fri, 23 Dec 2016 12:11:12 +0000 (12:11 +0000)]
opcodes: Use autoconf to check for `bfd_mips_elf_get_abiflags' in BFD
Fix a regression introduced with commit
5e7fc731f80e ("MIPS/opcodes:
Also set disassembler's ASE flags from ELF structures"), further updated
with commit
4df995c77118 ("MIPS/opcodes: Also set disassembler's ASE
flags from ELF structures"), and use autoconf to check for the presence
of `bfd_mips_elf_get_abiflags' in BFD.
opcodes/
* mips-dis.c (set_default_mips_dis_options): Use
HAVE_BFD_MIPS_ELF_GET_ABIFLAGS rather than BFD64 to guard the
call to `bfd_mips_elf_get_abiflags'.
* configure.ac: Check for `bfd_mips_elf_get_abiflags' in BFD.
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add `libbfd.la'.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* Makefile.in: Regenerate.