Commit Graph

87435 Commits

Author SHA1 Message Date
Maciej W. Rozycki 4512dafa50 MIPS/GAS: Cut TLS reloc dead code path in `md_apply_fix'
With code refactoring made in commit b886a2ab0d and the addition of
`calculate_reloc' and a separate test for TLS relocs against constants
made there the preexisting fall-through from the TLS reloc switch case
has effectively become a dead execution path.  This is because the call
to `calculate_reloc' present there is only made if `fixP->fx_done' is
true, which can only be the case if `fixP->fx_addsy' is NULL, which in
turn has already triggered the TLS reloc test and made execution break
out of the switch statement.

Remove the fall-through then and reshape code accordingly.

	gas/
	* config/tc-mips.c (md_apply_fix)
	<BFD_RELOC_MIPS16_TLS_TPREL_LO16>: Remove fall-through, adjust
	code accordingly.
2016-05-24 14:09:03 +01:00
Trevor Saunders cc34adb290 xtensa: make map_suffix_reloc_to_operator return operatorT
It always returns an element of the enum operatorT, so it should be clearer to
make that the return type.

gas/ChangeLog:

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

	* config/tc-xtensa.c (struct suffix_reloc_map): Change type of field
	operator to operatorT.
	(map_suffix_reloc_to_operator): Change return type to operatorT.
2016-05-24 08:57:36 -04:00
Trevor Saunders c023823f5f d30v: make var type operatorT
gas/ChangeLog:

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

	* config/tc-d30v.c (find_format): Change type of X_op to operatorT.
2016-05-24 08:55:45 -04:00
Trevor Saunders 049efc6495 mmix: constify handler_charp
gas/ChangeLog:

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

	* config/tc-mmix.c (mmix_parse_predefined_name): Change type of
	handler_charp to const char *.
2016-05-24 08:52:45 -04:00
Trevor Saunders b19e0aeb53 ft32: fixup TARGET_FORMAT
Nothing ever assigns to ft32_target_format, so its always null, which means the
bfd target arch is the default one.  It looks like ft32 only has one target
format, so we can just define TARGET_FORMAT to be that literal string.

gas/ChangeLog:

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

	* config/tc-ft32.h (DEFAULT_TARGET_FORMAT): Remove.
	(ft32_target_format): Likewise.
	(TARGET_FORMAT): Adjust.
2016-05-24 08:49:46 -04:00
Trevor Saunders e5e27b0769 ia64: use XOBNEW and XOBNEWVEC
gas/ChangeLog:

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

	* config/tc-ia64.c (dot_rot): simplify allocations from obstacks.
	(ia64_frob_label): Likewise.
2016-05-24 08:47:02 -04:00
Trevor Saunders 6610dc6daa change some variable's type to op_err
They only hold values from the op_err enum, so it should be clearer to give
them the enum type.

gas/ChangeLog:

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

	* config/tc-cr16.c (check_range): Make type of retval op_err.
	* config/tc-crx.c: Likewise.
2016-05-24 08:44:19 -04:00
Francis Ricci e70a7231e6 Fix syntax error in annota-input-while-running.exp
This patch fixes a syntax error which caused a failure in
annota-input-while-running.exp to crash the test suite runner.

2016-05-24  Francis Ricci  <francisjricci@gmail.com>

	* gdb.base/annota-input-while-running.exp: Fix syntax error.
2016-05-24 12:11:38 +01:00
Yan-Ting Lin 00a3cb9c7c Add myself as a write-after-approval GDB maintainer
gdb/ChangeLog:

	* MAINTAINERS (Write After Approval): Add "Yan-Ting Lin".
2016-05-24 16:47:14 +08:00
GDB Administrator c17cd11248 Automatic date update in version.in 2016-05-24 00:00:18 +00:00
Jim Wilson b7f28d873c Enable R_AARCH64_NONE for 64-bit code.
* elfnn-aarch64.c: Unconditionally enable R_AARCH64_NULL and
	R_AARCH64_NONE.  Use HOWTO64 for R_AARCH64_NULL.
	* relocs.c: Add BFD_RELOC_AARCH64_NULL.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Likewise.
2016-05-23 16:38:21 -07:00
Yao Qi 7eb895307f Skip unwritable frames in command "finish"
Nowadays, GDB can't insert breakpoint on the return address of the
exception handler on ARM M-profile, because the address is a magic
one 0xfffffff9,

 (gdb) bt
 #0  CT32B1_IRQHandler () at ../src/timer.c:67
 #1  <signal handler called>
 #2  main () at ../src/timer.c:127

(gdb) info frame
Stack level 0, frame at 0x200ffa8:
 pc = 0x4ec in CT32B1_IRQHandler (../src/timer.c:67); saved pc = 0xfffffff9
 called by frame at 0x200ffc8
 source language c.
 Arglist at 0x200ffa0, args:
 Locals at 0x200ffa0, Previous frame's sp is 0x200ffa8
 Saved registers:
  r7 at 0x200ffa0, lr at 0x200ffa4

(gdb) x/x 0xfffffff9
0xfffffff9:     Cannot access memory at address 0xfffffff9

(gdb) finish
Run till exit from #0  CT32B1_IRQHandler () at ../src/timer.c:67
Ed:15: Target error from Set break/watch: Et:96: Pseudo-address (0xFFFFFFxx) for EXC_RETURN is invalid (GDB error?)

Warning:
Cannot insert hardware breakpoint 0.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.

Command aborted.

even some debug probe can't set hardware breakpoint on the magic
address too,

(gdb) hbreak *0xfffffff9
Hardware assisted breakpoint 2 at 0xfffffff9
(gdb) c
Continuing.
Ed:15: Target error from Set break/watch: Et:96: Pseudo-address (0xFFFFFFxx) for EXC_RETURN is invalid (GDB error?)

Warning:
Cannot insert hardware breakpoint 2.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.

Command aborted.

The problem described above is quite similar to PR 8841, in which GDB
can't set breakpoint on signal trampoline, which is mapped to a read-only
page by kernel.  The rationale of this patch is to skip "unwritable"
frames when looking for caller frames in command "finish", and a new
gdbarch method code_of_frame_writable is added.  This patch fixes
the problem on ARM cortex-m target, but it can be used to fix
PR 8841 too.

gdb:

2016-05-10  Yao Qi  <yao.qi@arm.com>

	* arch-utils.c (default_code_of_frame_writable): New function.
	* arch-utils.h (default_code_of_frame_writable): Declare.
	* arm-tdep.c (arm_code_of_frame_writable): New function.
	(arm_gdbarch_init): Install gdbarch method
	code_of_frame_writable if the target is M-profile.
	* frame.c (skip_unwritable_frames): New function.
	* frame.h (skip_unwritable_frames): Declare.
	* gdbarch.sh (code_of_frame_writable): New.
	* gdbarch.c, gdbarch.h: Re-generated.
	* infcmd.c (finish_command): Call skip_unwritable_frames.
2016-05-23 17:32:56 +01:00
Tom Tromey 0f6ed0e0ef Fix PR python/19438, PR python/18393 - initialize dictionaries
This fixes PR python/19438 and PR python/18393.  Both bugs are about
invoking dir() on some Python object implemented by gdb, and getting a
crash.

The crash happens because the dictionary field of these objects was
not initialized.  Apparently what happens is that this field can be
lazily initialized by Python when assigning to an attribute; and it
can also be handled ok when using dir() but without __dict__ defined;
but gdb defines __dict__ because this isn't supplied automatically by
Python.

The docs on this seem rather sparse, but this patch works ok.

An alternative might be to lazily create the dictionary in
gdb_py_generic_dict, but I went with this approach because it seemed
more straightforward.

Built and regtested on x86-64 Fedora 23.

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

	PR python/19438, PR python/18393:
	* python/py-objfile.c (objfpy_initialize): Initialize self->dict.
	* python/py-progspace.c (pspy_initialize): Initialize self->dict.

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

	PR python/19438, PR python/18393:
	* gdb.python/py-progspace.exp: Add "dir" test.
	* gdb.python/py-objfile.exp: Add "dir" test.
2016-05-23 10:08:34 -06:00
Claudiu Zissulescu d9eca1df01 [ARC] Update instruction type and delay slot info.
This patch corrects the instructioninformation passed into the
disassebler_info structure.

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

	* opcode/arc.h (insn_subclass_t): Add COND.
	(flag_class_t): Add F_CLASS_EXTEND.

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

	* arc-dis.c (print_flags): Set branch_delay_insns, and insn_type
	information.
	(print_insn_arc): Set insn_type information.
	* arc-opc.c (C_CC): Add F_CLASS_COND.
	* arc-tbl.h (bbit0, bbit1): Update subclass to COND.
	(beq_s, bge_s, bgt_s, bhi_s, bhs_s): Likewise.
	(ble_s, blo_s, bls_s, blt_s, bne_s): Likewise.
	(breq, breq_s, brge, brhs, brlo, brlt): Likewise.
	(brne, brne_s, jeq_s, jne_s): Likewise.
2016-05-23 17:41:54 +02:00
Claudiu Zissulescu 87789e08e5 [ARC] Add XY registers, update neg instruction.
gas/
2016-05-23  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/tc-arc.c (md_begin): Add XY registers.
	(cpu_types): Code density is default off for ARC EM.

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

	* arc-tbl.h (neg): New instruction variant.
2016-05-23 17:32:13 +02:00
Claudiu Zissulescu c810e0b87a [ARC] Rename "class" named attributes.
gas/
2016-05-23  Cupertino Miranda  <cmiranda@synopsys.com>

	* config/tc-arc.c (attributes_t): Renamed attribute class to
	attr_class.
	(find_opcode_match, assemble_insn, tokenize_extinsn): Changed.

opcode/
2016-05-23  Cupertino Miranda  <cmiranda@synopsys.com>

	* arc-dis.c (find_format, find_format, get_auxreg)
	(print_insn_arc): Changed.
	* arc-ext.h (INSERT_XOP): Likewise.

include/
2016-05-23  Cupertino Miranda  <cmiranda@synopsys.com>

	* opcode/arc.h (struct arc_opcode): Renamed attribute class to
	insn_class.
	(struct arc_flag_class): Renamed attribute class to flag_class.
2016-05-23 17:25:46 +02:00
Yao Qi ffd19d610b Use standard_testfile in gdb.arch/thumb-prologue.exp and gdb.arch/thumb2-it.exp
This patch fixes the errors below:

Running /home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.arch/thumb-prologue.exp ...
gdb compile failed, arm-linux-gnueabihf/bin/ld: cannot open output file /scratch/yao/gdb/build-git/arm-linux-gnueabihf/gdb/testsuite/gdb.arch/thumb-prologue: No such file or directory
collect2: error: ld returned 1 exit status
Running /home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.arch/thumb2-it.exp ...
gdb compile failed, arm-linux-gnueabihf/bin/ld: cannot open output file /scratch/yao/gdb/build-git/arm-linux-gnueabihf/gdb/testsuite/gdb.arch/thumb2-it: No such file or directory

gdb/testsuite:

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

	* gdb.arch/thumb-prologue.exp: Use standard_testfile.
	* gdb.arch/thumb2-it.exp: Likewise.
2016-05-23 15:50:56 +01:00
Nick Clifton d26a14db86 oops - omitted from previous delta 2016-05-23 13:56:46 +01:00
Kuba Sejdak a2bea3245e Add support for configuring for the ARM Phoenix target.
bfd	* config.bfd: Add entry for arm-phoenix.

gas	* configuse.tgt: Add entry for arm-phoenix.

ld	* Makefile.am: Add earmelf_phoenix.c.
	* Makefile.in: Regenerate.
	* configure.tgt: Add entry for arm-phoenix.
	* emulparams/armelf_phoenix.sh: New file.
2016-05-23 13:53:07 +01:00
Gary Benson d0571b9934 Remove unused libthread_db td_thr_validate reference
Native GDB looks up the function td_thr_validate from libthread_db.so
on Linux, but the value is never used.  This commit removes this dead
code.

gdb/ChangeLog:

	* nat/gdb_thread_db.h (td_thr_validate_ftype): Remove typedef.
	* linux-thread-db.c (struct thread_db_info) <td_thr_validate_p>:
	Remove field.
	(try_thread_db_load_1): Remove td_thr_validate initialization.
2016-05-23 13:26:47 +01:00
Nick Clifton b43b853577 Sync config.guess and config.sub with FSF GCC mainline versions 2016-05-23 11:42:17 +01:00
Thomas Preud'homme d7c5bd02f7 Support for dedicated ARM stub section with padding
2016-05-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
	* elf32-arm.c (arm_dedicated_stub_section_padding): New function.
	(elf32_arm_size_stubs): Declare stub_type in a more outer scope and
	account for padding for stub section requiring one.
	(elf32_arm_build_stubs): Add comment to stress the importance of
	zeroing veneer section content.
2016-05-23 09:41:36 +01:00
Thomas Preud'homme daa4adae63 Support for dedicated output section for some ARM veneer types
2016-05-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
	* bfd-in.h (bfd_elf32_arm_keep_private_stub_output_sections): Declare
	bfd hook.
	* bfd-in2.h: Regenerate.
	* elf32-arm.c (arm_dedicated_stub_output_section_required): New
	function.
	(arm_dedicated_stub_output_section_required_alignment): Likewise.
	(arm_dedicated_stub_output_section_name): Likewise.
	(arm_dedicated_stub_input_section_ptr): Likewise.
	(elf32_arm_create_or_find_stub_sec): Add stub type parameter and
	function description comment. Add support for dedicated output stub
	section to given stub types.
	(elf32_arm_add_stub): Add a stub type parameter and pass it down to
	elf32_arm_create_or_find_stub_sec.
	(elf32_arm_create_stub): Pass stub type down to elf32_arm_add_stub.
	(elf32_arm_size_stubs): Pass stub type when calling
	elf32_arm_create_or_find_stub_sec for Cortex-A8 erratum veneers.
	(bfd_elf32_arm_keep_private_stub_output_sections): New function.

ld/
	* emultempl/armelf.em (arm_elf_before_allocation): Call
	bfd_elf32_arm_keep_private_stub_output_sections before generic
	before_allocation function.
2016-05-23 09:38:32 +01:00
Jon Boden 37773e7803 Search for libutil-freebsd as alternative to libutil
GDB needs kinfo_getvmmap() on GNU/kFreeBSD systems same as on
pure FreeBSD.  However on these systems the FreeBSD version of libutil
is renamed to libutil-freebsd.

2016-05-23  Jon Boden  <jon@ubuntubsd.org>

	* configure.ac: Search for libutil-freebsd as alternative to libutil.
	* configure: Re-generated.
2016-05-23 08:46:33 +01:00
Trevor Saunders f10e0aef4f tic54x: use concat more
gas/ChangeLog:

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

	* config/tc-tic54x.c (tic54x_sect): simplify string creation.
2016-05-23 01:21:07 -04:00
Trevor Saunders 2900e701e0 spu: make some constants unsigned
The field in spu_opcode is unsigned, and for some values of opcode we can end
up shifting into the high bit.  So avoid possibly creating a negative number
and then assigning it to a unsigned field by shifting an unsigned constant.

gas/ChangeLog:

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

	* config/tc-spu.c (APUOP): Use OPCODE as an unsigned constant.
2016-05-23 01:20:09 -04:00
Trevor Saunders 3d207518c1 tic54x: rename typedef of struct symbol_
generic gas code has a struct symbol, and tic54x typedefs a struct to symbol.
This seems at least rather confusing, and it seems like target specific headers
shouldn't  put such generic names in the global namespace preventing other
generic code from using them.

opcodes/ChangeLog:

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

	* tic54x-dis.c (sprint_mmr): Adjust.
	* tic54x-opc.c: Likewise.

gas/ChangeLog:

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

	* config/tc-tic54x.c (tic54x_mmregs): Adjust.
	(md_begin): Likewise.
	(encode_condition): Likewise.
	(encode_cc3): Likewise.
	(encode_cc2): Likewise.
	(encode_operand): Likewise.
	(tic54x_undefined_symbol): Likewise.

include/ChangeLog:

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

	* opcode/tic54x.h (struct symbol_): typedef to tic54x_symbol instead of
	plain symbol.
2016-05-23 01:17:12 -04:00
GDB Administrator 82418e18f8 Automatic date update in version.in 2016-05-23 00:00:19 +00:00
GDB Administrator 666a13303c Automatic date update in version.in 2016-05-22 00:00:19 +00:00
GDB Administrator c8eaca27ff Automatic date update in version.in 2016-05-21 00:00:22 +00:00
H.J. Lu 52bf37dd91 Don't check R_386_GOT32 when setting need_convert_load
Since we no longer convert R_386_GOT32, don't check R_386_GOT32 when
setting need_convert_load.

	* elf32-i386.c (elf_i386_check_relocs): Don't check R_386_GOT32
	when setting need_convert_load.
2016-05-20 09:36:48 -07:00
Matthew Fortune a4968f42e7 MIPS: Add support for P6600
gas/
	* config/tc-mips.c (mips_cpu_info_table): Update comment. Add
	p6600 entry.
	* doc/c-mips.texi: Document p6600 -march option.
2016-05-20 15:21:10 +01:00
H.J. Lu 4e21640f67 Preserve addend for R_386_GOT32 and R_X86_64_GOT32
We should preserve addend for R_386_GOT32 and R_X86_64_GOT32 as in
"movl $foo@GOT + 4, %eax" and "movq $foo@GOT + 4, %rax".

	PR gas/19600
	* config/tc-i386.c (md_apply_fix): Preserve addend for
	BFD_RELOC_386_GOT32 and BFD_RELOC_X86_64_GOT32.
	* testsuite/gas/i386/addend.d: New file.
	* testsuite/gas/i386/addend.s: Likewise.
	* testsuite/gas/i386/x86-64-addend.d: Likewise.
	* testsuite/gas/i386/x86-64-addend.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run addend and x86-64-addend.
	* testsuite/gas/i386/reloc32.d: Updated.
2016-05-20 06:01:28 -07:00
Maciej W. Rozycki 17c6c9d9f3 MIPS: Fix the encoding of immediates with microMIPS JALX
The microMIPS JALX instruction shares the R_MICROMIPS_26_S1 relocation
with microMIPS J/JAL/JALS instructions, however unlike the latters its
encoded immediate argument is unusually shifted left by 2 rather than 1
in calculating the value used for the operation requested.

We already handle this exception in `mips_elf_calculate_relocation' in
LD, in a scenario where JALX is produced as a result of relaxing JAL for
the purpose of making a cross-mode jump.  We also get it right in the
disassembler in `decode_micromips_operand'.

What we don't correctly do however is processing microMIPS JALX produced
by GAS from an assembly source, where a non-zero constant argument or a
symbol reference with a non-zero in-place addend has been used.  In this
case the same calculation is made as for microMIPS J/JAL/JALS, causing
the wrong encoding to be produced by GAS on making an object file, and
then again by LD in the final link.  The latter in particular causes the
calculation, where the addend fits in the relocatable field, to produce
different final addresses for the same source code depending on whether
REL or RELA relocations are used.

Correct these issues by special-casing microMIPS JALX in the places that
have been previously missed.

	bfd/
	* elfxx-mips.c (mips_elf_read_rel_addend): Adjust the addend for
	microMIPS JALX.

	gas/
	* config/tc-mips.c (append_insn): Correct the encoding of a
	constant argument for microMIPS JALX.
	(tc_gen_reloc): Correct the encoding of an in-place addend for
	microMIPS JALX.
	* testsuite/gas/mips/jalx-addend.d: New test.
	* testsuite/gas/mips/jalx-addend-n32.d: New test.
	* testsuite/gas/mips/jalx-addend-n64.d: New test.
	* testsuite/gas/mips/jalx-imm.d: New test.
	* testsuite/gas/mips/jalx-imm-n32.d: New test.
	* testsuite/gas/mips/jalx-imm-n64.d: New test.
	* testsuite/gas/mips/jalx-addend.s: New test source.
	* testsuite/gas/mips/jalx-imm.s: New test source.
	* testsuite/gas/mips/mips.exp: Run the new tests.

	ld/
	* testsuite/ld-mips-elf/jalx-addend.d: New test.
	* testsuite/ld-mips-elf/jalx-addend-n32.d: New test.
	* testsuite/ld-mips-elf/jalx-addend-n64.d: New test.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2016-05-20 13:38:48 +01:00
Maciej W. Rozycki 134c0c8bf4 MIPS/GAS: Correct tab-after-space formatting mistakes
* config/tc-mips.c: Correct tab-after-space formatting mistakes
	throughout.
2016-05-20 12:41:50 +01:00
GDB Administrator d310f46e33 Automatic date update in version.in 2016-05-20 00:00:10 +00:00
Cary Coutant 6eeb0170bb Don't allow COPY relocations for protected symbols.
gold/
	PR gold/19823
	* copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
	parameter; check for protected symbol.
	* copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
	* mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
	* symtab.cc (Symbol::init_fields): Initialize is_protected_.
	(Symbol_table::add_from_dynobj): Mark protected symbols.
	* symtab.h (Symbol::is_protected): New method.
	(Symbol::set_is_protected): New method.
	(Symbol::is_protected_): New data member.

	* testsuite/Makefile.am (copy_test_protected): New test.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/copy_test.cc (main): Add legal reference to protected
	symbol.
	* testsuite/copy_test_v1.cc (main): Likewise.
	* testsuite/copy_test_2.cc (ip): Add protected symbol.
	* testsuite/copy_test_protected.cc: New test source file.
	* testsuite/copy_test_protected.sh: New test script.
2016-05-19 15:05:03 -07:00
Vladimir Radosavljevic 15eb1bebe1 Fix non-deterministic behavior when generating MIPS GOT.
* mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
	for global got symbols, and set addend to 0.
	(Mips_got_entry::hash): Change hash algorithm.
	(Mips_got_entry::equals): Refactor.
	(Mips_got_entry::object): Return input object for local got symbols
	from union d.
	(Mips_got_entry::addend): Change return of the relocation addend.
	(Mips_got_entry::addend_): Move from union d.
	(Mips_got_entry::object_): Move into union d.
	(class Mips_symbol_hash): New class.
	(Mips_got_info::Global_got_entry_set): New type.
	(Mips_got_info::global_got_symbols): Change return type to
	Global_got_entry_set.
	(Mips_got_info::global_got_symbols_): Change type to
	Global_got_entry_set.
	(Mips_symbol::hash): New method.
	(Mips_output_data_la25_stub::symbols_): Change type to std::vector.
	(Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
	(Mips_output_data_mips_stubs::symbols_): Change type to
	Mips_stubs_entry_set.
	(Mips_got_info::record_global_got_symbol): Don't pass object
	argument when creating global got symbol.
	(Mips_got_info::record_got_entry): Remove find before inserting
	got entries.
	(Mips_got_info::add_reloc_only_entries): Change type of iterator
	to Global_got_entry_set.
	(Mips_got_info::count_got_symbols): Likewise.
	(Mips_output_data_la25_stub::create_la25_stub): Use push_back
	for adding entries to symbols_.
	(Mips_output_data_la25_stub::do_write): Change type of iterator
	to std::vector.
	(Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
	of iterator to Mips_stubs_entry_set.
	(Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
	(Mips_output_data_mips_stubs::do_write): Likewise.
2016-05-19 15:04:51 -07:00
H.J. Lu 7d4d970973 Don't convert R_386_GOT32 relocation
Don't convert R_386_GOT32 since we can't tell if it is applied
to "mov $foo@GOT, %reg" which isn't a load via GOT.

bfd/

	PR ld/20117
	* elf32-i386.c (elf_i386_convert_load_reloc): Don't check
	R_386_GOT32X.
	(elf_i386_convert_load): Don't convert R_386_GOT32.

ld/

	PR ld/20117
	* testsuite/ld-i386/i386.exp: Run pr20117.
	* testsuite/ld-i386/pr19609-1i.d: Updated.
	* testsuite/ld-i386/pr20117.d: New file.
	* testsuite/ld-i386/pr20117.s: Likewise.
2016-05-19 12:57:11 -07:00
Alan Modra 606851fbf6 Set sh_entsize for .init_array and similar.
PR gas/20118
	* elf.c (elf_fake_sections): Set sh_entsize for SHT_INIT_ARRAY,
	SHT_FINI_ARRAY, and SHT_PREINIT_ARRAY.
2016-05-20 00:35:24 +09:30
Andreas Schwab bfb0d950a5 Fix invalid implicit conversions from void *
* ia64-libunwind-tdep.c (libunwind_descr): Add cast from void *.
	(libunwind_frame_set_descr): Likewise.
	(libunwind_frame_cache): Likewise.
	(libunwind_frame_dealloc_cache): Likewise.
	(libunwind_frame_sniffer): Likewise.
	(libunwind_search_unwind_table): Likewise.
	(libunwind_sigtramp_frame_sniffer): Likewise.
	(libunwind_get_reg_special): Likewise.
	(libunwind_load): Likewise.
	* ia64-linux-nat.c (ia64_linux_fetch_register): Likewise.
	(ia64_linux_store_register): Likewise.
	(ia64_linux_xfer_partial): Likewise.
	* ia64-tdep.c (ia64_access_reg): Likewise.
	(ia64_access_fpreg): Likewise.
	(ia64_access_rse_reg): Likewise.
	(ia64_access_rse_fpreg): Likewise.
2016-05-19 15:31:56 +02:00
Claudiu Zissulescu fc3eec7ebd [ARC] Fixed-linker-related-testsuite-for-ARC
ld/
2016-05-19  Cupertino Miranda  <cmiranda@synopsys.com>

	* testsuite/ld-elf/compressed1d.d: Removed from notarget.
	* 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/pr12851.d: Likewise.
	* testsuite/ld-elf/pr12975.d: Likewise.
	* testsuite/ld-elf/pr13177.d: Likewise.
	* testsuite/ld-elf/pr13195.d: Likewise.
	* testsuite/ld-elf/pr17615.d: Likewise.
	* testsuite/ld-elf/eh-frame-hdr.d: Removed from xfail.
	* testsuite/ld-elf/group3b.d: Likewise.
	* testsuite/ld-srec/srec.exp: Likewise.
	* testsuite/lib/ld-lib.exp (check_gc_sections_available): Mark ARC
	as supporting gc.
	(check_shared_lib_support): Mark ARC as supporting.
2016-05-19 15:06:51 +02:00
Claudiu Zissulescu c0913ebfaf [ARC] Emulation and default script template changes.
2016-05-19  Cupertino Miranda  <cmiranda@synopsys.com>

	* emulparams/arcelf.sh: Changed.
	* emulparams/arclinux.sh: Likewise.
	* scripttempl/arclinux.sc: Moved to a more standard implementation
	similar to elf.sc.
2016-05-19 15:06:50 +02:00
Claudiu Zissulescu 3c8adacaf9 [ARC] BFD fixes.
2016-05-19  Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (arc_elf_final_write_processing): Changed.
	(debug_arc_reloc): Likewise.
	(elf_arc_relocate_section): Likewise.
	(elf_arc_check_relocs): Likewise.
	(elf_arc_adjust_dynamic_symbol): Likewise.
	(elf_arc_add_symbol_hook): Likewise.
2016-05-19 15:06:49 +02:00
Maciej W. Rozycki c4107a7def LD/testsuite: Fix `ft32-*-*' position in `check_shared_lib_support'
ld/
	* testsuite/lib/ld-lib.exp (check_shared_lib_support): Reorder
	`ft32-*-*' behind `frv-*-*'.
2016-05-19 11:19:04 +01:00
Maciej W. Rozycki 6b200de0f7 Remove unsupported `am34-*-linux*' target triplet
The `am34-*-linux*' target cannot be configured for, `am34' is not a CPU
name recognized by `config.sub'.  It has never been, required code has
not been contributed to GNU config, neither before nor since the
addition of the target triplet to our configury with commit bfff164249
("Add MN10300 linker relaxation support for symbol differences") back in
2007.  Also there is no difference in actual tool configuration between
the `am34-*-linux*' and `am33_2.0-*-linux*' targets, except from a
different executable prefix and tooldir name.

Given the above remove the target triplet from our configuration.

	bfd/
	* config.bfd: Remove `am34-*-linux*' support.

	ld/
	* configure.tgt: Remove `am34-*-linux*' support.
2016-05-19 11:13:10 +01:00
Alan Modra 514e58b726 Correct "Fix powerpc subis range"
* ppc-opc.c (NSISIGNOPT): Use insert_nsi and extract_nsi.
2016-05-19 16:56:02 +09:30
Alan Modra e43de63c8f Fix powerpc subis range
* ppc-opc.c: Formatting.
	(NSISIGNOPT): Define.
	(powerpc_opcodes <subis>): Use NSISIGNOPT.
2016-05-19 14:18:11 +09:30
Alan Modra 82bc9362f1 Hack crossref tests for powerpc64
A different set of hacks to make the crossref tests pass on powerpc64
and powerpc64le.

	* testsuite/ld-scripts/crossref.exp: Remove -mcall-aixdesc hack.
	* testsuite/ld-scripts/cross2.t: Tweak .opd and .toc placement.
	* testsuite/ld-scripts/cross3.t: Likewise.
	* testsuite/ld-scripts/cross4.t: Likewise.
	* testsuite/ld-scripts/cross5.t: Likewise.
	* testsuite/ld-scripts/cross6.t: Likewise.
	* testsuite/ld-scripts/cross7.t: Likewise.
2016-05-19 14:07:06 +09:30
Alan Modra f1b2ca70c9 ld-elf/shared.exp mix_pic_and_non_pic
Tweaks to make it easier to re-run these testcases by hand.

	* testsuite/ld-elf/shared.exp (mix_pic_and_non_pic): Pass in
	exe name rather than constructing testname.  Fix typo in
	sub-test name.  Log copying.  Use -rpath rather than -R.
2016-05-19 14:07:05 +09:30