bfd/
* elfxx-mips.h (_bfd_mips_elf_get_synthetic_symtab): New
prototype.
* elf32-mips.c (elf_backend_plt_sym_val): Remove macro.
(bfd_elf32_get_synthetic_symtab): New macro.
* elfxx-mips.c (plt_entry): New structure.
(mips_elf_link_hash_entry): Add use_plt_entry member.
(mips_elf_link_hash_table): Rename plt_entry_size member to
plt_mips_entry_size. Add plt_comp_entry_size, plt_mips_offset,
plt_comp_offset, plt_got_index entries and plt_header_is_comp
members.
(STUB_LW_MICROMIPS, STUB_MOVE_MICROMIPS): New macros.
(STUB_LUI_MICROMIPS, STUB_JALR_MICROMIPS): Likewise.
(STUB_ORI_MICROMIPS, STUB_LI16U_MICROMIPS): Likewise.
(STUB_LI16S_MICROMIPS): Likewise.
(MICROMIPS_FUNCTION_STUB_NORMAL_SIZE): Likewise.
(MICROMIPS_FUNCTION_STUB_BIG_SIZE): Likewise.
(micromips_o32_exec_plt0_entry): New variable.
(mips16_o32_exec_plt_entry): Likewise.
(micromips_o32_exec_plt_entry): Likewise.
(mips_elf_link_hash_newfunc): Initialize use_plt_entry.
(mips_elf_output_extsym): Update to use gotplt_union's plist
member rather than offset.
(mips_elf_gotplt_index): Likewise. Remove the VxWorks
restriction. Use MIPS_ELF_GOT_SIZE to calculate GOT address.
(mips_elf_count_got_symbols): Update to use gotplt_union's plist
member rather than offset.
(mips_elf_calculate_relocation): Handle MIPS16/microMIPS PLT
entries.
(_bfd_mips_elf_create_dynamic_sections): Don't set PLT sizes
here.
(mips_elf_make_plt_record): New function.
(_bfd_mips_elf_check_relocs): Update comment. Record occurences
of JAL relocations that might need a PLT entry.
(_bfd_mips_elf_adjust_dynamic_symbol): Update to use
gotplt_union's plist member rather than offset. Set individual
PLT entry sizes here. Handle MIPS16/microMIPS PLT entries.
Don't set the symbol's value in the symbol table for PLT
references here. Don't set the PLT or PLT GOT section sizes
here.
(mips_elf_estimate_stub_size): Handle microMIPS stubs.
(mips_elf_allocate_lazy_stub): Likewise.
(mips_elf_lay_out_lazy_stubs): Likewise. Define a _MIPS_STUBS_
magic symbol.
(mips_elf_set_plt_sym_value): New function.
(_bfd_mips_elf_size_dynamic_sections): Set PLT header size and
PLT and PLT GOT section sizes here. Set the symbol values in
the symbol table for PLT references here. Handle microMIPS
annotation of the _PROCEDURE_LINKAGE_TABLE_ magic symbol.
(_bfd_mips_elf_finish_dynamic_symbol): Update to use
gotplt_union's plist member rather than offset. Handle
MIPS16/microMIPS PLT entries. Handle microMIPS stubs.
(_bfd_mips_vxworks_finish_dynamic_symbol): Update to use
gotplt_union's plist member rather than offset. Use
MIPS_ELF_GOT_SIZE to calculate GOT address.
(mips_finish_exec_plt): Handle microMIPS PLT. Return status.
(_bfd_mips_elf_finish_dynamic_sections): Handle result from
mips_finish_exec_plt.
(_bfd_mips_elf_link_hash_table_create): Update to use
gotplt_union's plist member rather than offset.
(_bfd_mips_elf_get_synthetic_symtab): New function.
gdb/
* mips-tdep.c (mips_elf_make_msymbol_special): Handle MIPS16 and
microMIPS synthetic symbols.
ld/
* emulparams/elf32btsmip.sh: Arrange for .got.plt to be placed
as close to .plt as possible.
* scripttempl/elf.sc: Handle $INITIAL_READWRITE_SECTIONS and
$PLT_NEXT_DATA variables.
gas/testsuite/
* gas/all/gas.exp: Remove reference to mips-ecoff.
* gas/mips/branch-misc-1.d, gas/mips/branch-misc-2.d,
gas/mips/branch-misc-2-64.d, gas/mips/branch-misc-2pic.d,
gas/mips/branch-misc-2pic-64.d, gas/mips/branch-swap.d: Remove
skips for mips-*-ecoff.
ld/
* NEWS: Document the removal of MIPS ECOFF targets.
* ld.texinfo (--gpsize=@var{value}): Use MIPS ELF rather than
MIPS ECOFF as an example of a target that supports small data.
* ldmain.c (g_switch_value): Likewise.
* configure.tgt (mips*-*-pe, mips*-dec-ultrix*, mips*-dec-osf*)
(mips*-sgi-irix* [v4 and earlier], mips*el-*-ecoff*, mips*-*-ecoff*)
(mips*-*-bsd*, mips*-*-lnews*): Remove cases.
* Makefile.am (ALL_EMULATION_SOURCES): Remove emipsbig.c, emipsbsd.c,
emipsidt.c, emipsidtl.c, emipslit.c, emipslnews.c and emipspe.c.
(emipsbig.c, emipsbsd.c, emipsidt.c, emipsidtl.c, emipslit.c)
(emipslnews.c, emipspe.c): Delete rules.
* Makefile.in: Regenerate.
* emulparams/mipsbig.sh, emulparams/mipsbsd.sh, emulparams/mipsidt.sh,
emulparams/mipsidtl.sh, emulparams/mipslit.sh, emulparams/mipslnews.sh,
emulparams/mipspe.sh, emultempl/mipsecoff.em: Delete.
* emultempl/m68kcoff.em: Update comment to say that MIPS ECOFF support
has now been removed.
* emultempl/pe.em: Remove TARGET_IS_mipspe checks.
Import the latest version of strlen from the Linaro cortex-strings
package. This version is faster across a variety of block size and
alignments on ARMv7.
newlib/ChangeLog:
2013-06-21 Will Newton <will.newton@linaro.org>
* libc/machine/arm/strlen-armv7.S: Import latest strlen
code from Linaro cortex-strings.
* spawn.cc (child_info_spawn::worker): Eliminate call to newargv.set() in favor
of conglomerated newargv.setup(). Let newargv.setup() decide when to call
dup_all(). Only set argc and argv for cygwin processes.
(av::setup): Rename from av::fixup. Accept argc and argv parameters. Fill out
argv and argc here. Duplicate whole argv structure when this is a Cygwin
executable.
* winf.cc (linebuf::fromargv): Don't bother duplicating argv elements since
they will never be used.
* winf.h (av::set): Delete.
(av::setup): Rename from av::fixup. Add two parameters.
(av::replace0_maybe): Assign calloced to 1 rather than 'true' for clarity.
(av::dup_maybe): Delete.
(av::dup_all): Set calloced to show that we have duplicated all of the
arguments in the list.
Corinna Vinschen [Wed, 19 Jun 2013 15:24:48 +0000 (15:24 +0000)]
* nlsfuncs.cc (__collate_range_cmp): Convert input to wchar_t and call
wcscoll since all calling functions are using wide chars. Explain in
preceeding comment.
Corinna Vinschen [Mon, 17 Jun 2013 08:33:41 +0000 (08:33 +0000)]
* times.cc (GetSystemTimePreciseAsFileTime): Add comment to declaration.
(__to_clock_t): Remove a debug_printf.
(times): Align syscall_printf to debug output of other system calls.
Corinna Vinschen [Fri, 14 Jun 2013 15:41:17 +0000 (15:41 +0000)]
* autoload.cc (GetSystemTimePreciseAsFileTime): Define.
* times.cc (GetSystemTimePreciseAsFileTime): Temporarily declare here
to workaround missing definition in 32 bit w32api headers.
(get_system_time): New always inline function to call either
GetSystemTimePreciseAsFileTime or GetSystemTimeAsFileTime on a per OS
basis. Call throughout instead of GetSystemTimeAsFileTime.
* wincap.h (wincaps::has_precise_system_time): New element.
* wincap.cc: Implement above element throughout.
Corinna Vinschen [Fri, 14 Jun 2013 09:09:41 +0000 (09:09 +0000)]
Streamline time/times functionality. Remove last remains of former
Windows 9x compatibility.
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Drop now unneeded
casts in calls to_timestruc_t.
(fhandler_base::utimens_fs): Ditto for timespec_to_filetime.
* fhandler_proc.cc (format_proc_stat): Ditto for to_time_t.
* hires.h (class hires_ms): Remove unused member initime_ns.
Remove declarations for timeGetTime_ns and prime.
(hires_ms::uptime): Remove.
* posix_ipc.cc (ipc_cond_timedwait): Ditto for timespec_to_filetime.
* fhandler_registry.cc (fhandler_registry::fstat): Add cast.
* resource.cc (fill_rusage): Call NtQueryInformationProcess rather than
GetProcessTimes to deal with LARGE_INTEGER rather than FILETIME.
* times.cc: Simplify time handling. Throughout, use LARGE_INTEGER
rather than FILETIME to simplify computations. Throughout use
{u}int64_t rather than {unsigned} long long. Drop unneeded casts since
NSPERSEC is 64 bit anyway.
(systime_ns): Remove.
(times): Call NtQuerySystemInformation to fetch boot time. Call
NtQueryInformationProcess rather than GetProcessTimes to deal with
LARGE_INTEGER rather than FILETIME. Call GetSystemTimeAsFileTime.
(totimeval): Use constant 1000000 as in other functions.
(time_t_to_filetime): Remove.
(to_time_t): Change return type to time_t.
(time_as_timestruc_t): Rename filetime to systime.
(time): Ditto. Add cast.
(hires_ns::nsecs): Fix return type cast.
(hires_ms::timeGetTime_ns): Remove.
(hires_ns::prime): Remove.
(hires_ms::nsecs): Drop call to prime. Call GetSystemTimeAsFileTime
directly. Subtract FACTOR here since it's the only function needing
to do so.
(minperiod): Cosmetically change to ULONG.
(hires_ns::resolution): Fix return type cast.
(hires_ms::resolution): Simplify, rely on NtQueryTimerResolution.
* winsup.h: Align time related prototypes to above changes.
Corinna Vinschen [Thu, 13 Jun 2013 19:37:14 +0000 (19:37 +0000)]
* net.cc (gen_old_if_name): New function to generate short interface
names for old pre-1.7 applications.
(get_ifs): Call gen_old_if_name for said old applications.
* exceptions.cc (try_to_debug): Don't use yield() when waiting for another
process.
(sigpacket::setup_handler): Fix long-standing problem where loop could exit
with lock held.
* cygwait.cc (cygwait): Remove lock around sig retrieval since this code is
essentially guarded by thread-specific signal_arrived.
* exceptions.cc (_cygtls::handle_SIGCONT): Simplify. Eliminate lock/unlock
since code is guarded by signal_arrived.
gas/
2013-06-08 Catherine Moore <clm@codesourcery.com>
* config/tc-mips.c (is_opcode_valid): Build ASE mask.
(is_opcode_valid_16): Pass ase value to opcode_is_member.
(append_insn): Change INSN_xxxx to ASE_xxxx.
include/
2013-06-08 Catherine Moore <clm@codesourcery.com>
* opcode/mips.h (mips_opcode): Add ase field.
(INSN_ASE_MASK): Delete.
(INSN_DSP): Rename to ASE_DSP. Provide new value.
(INSN_DSPR2): Rename to ASE_DSPR2. Provide new value.
(INSN_MCU): Rename to ASE_MCU. Provide new value.
(INSN_MDMX): Rename to ASE_MDMX. Provide new value.
(INSN_MIPS3d): Rename to ASE_MIPS3D. Provide new value.
(INSN_MT): Rename to ASE_MT. Provide new value.
(INSN_SMARTMIPS): Rename to ASE_SMARTMIPS. Provide new value.
(INSN_VIRT): Rename to ASE_VIRT. Provide new value.
(INSN_VIRT64): Rename to ASE_VIRT64. Provide new value.
(opcode_is_member): Add ase argument. Check ase.
opcodes/
2013-06-08 Catherine Moore <clm@codesourcery.com>
Richard Sandiford <rdsandiford@googlemail.com>
* micromips-opc.c (D32, D33, MC): Update definitions.
(micromips_opcodes): Initialize ase field.
* mips-dis.c (mips_arch_choice): Add ase field.
(mips_arch_choices): Initialize ase field.
(set_default_mips_dis_options): Declare and setup mips_ase.
* mips-opc.c (M3D, SMT, MX, IVIRT, IVIRT64, D32, D33, D64,
MT32, MC): Update definitions.
(mips_builtin_opcodes): Initialize ase field.
Will Newton [Fri, 7 Jun 2013 18:57:00 +0000 (18:57 +0000)]
aarch64: Add support for GNU indirect functions.
Add support for STT_GNU_IFUNC symbols to the AArch64 bfd backend. The tests
are ported from the ld-ifunc tests but are enabled for cross builds so can
be run easily without hardware or a simulator.
bfd/ChangeLog:
2013-06-07 Will Newton <will.newton@linaro.org>
* configure: Regenerate.
* configure.in: Build elf-ifunc.o for AArch64.
* elf64-aarch64.c: Include objalloc.h.
(elf64_aarch64_howto_dynrelocs): Add R_AARCH64_IRELATIVE howto.
(struct elf64_aarch64_link_hash_table): Add members for handling
R_AARCH64_IRELATIVE relocations.
(elf_aarch64_local_htab_hash): New function.
(elf_aarch64_local_htab_eq): New function.
(elf_aarch64_get_local_sym_hash): New function.
(elf64_aarch64_link_hash_table_create): Initialize local STT_GNU_IFUNC
symbol hash.
(elf64_aarch64_hash_table_free): Free local STT_GNU_IFUNC symbol hash.
(elf64_aarch64_final_link_relocate): Add sym argument. Add support
for handling STT_GNU_IFUNC symbols.
(elf64_aarch64_gc_sweep_hook): Add support for garbage collecting
references to STT_GNU_IFUNC symbols.
(elf64_aarch64_adjust_dynamic_symbol): Add support for handling
STT_GNU_IFUNC symbols.
(elf64_aarch64_check_relocs): Add support for handling STT_GNU_IFUNC
symbols. Ensure we don't increase plt.refcount from -1 to 0.
(elf64_aarch64_post_process_headers): Call _bfd_elf_set_osabi.
(elf64_aarch64_is_function_type): Remove function.
(elf64_aarch64_allocate_dynrelocs): Call
_bfd_elf_allocate_ifunc_dyn_relocs for STT_GNU_IFUNC symbols.
(elf_aarch64_allocate_local_dynrelocs): New function.
(elf64_aarch64_size_dynamic_sections): Call
elf_aarch64_allocate_local_dynrelocs. Initialize next_irelative_index.
(elf64_aarch64_create_small_pltn_entry): Add info argument.
Add support for creating .iplt entries for STT_GNU_IFUNC symbols.
(elf64_aarch64_finish_dynamic_symbol): Add support for handling
STT_GNU_IFUNC symbols and .iplt.
(elf_aarch64_finish_local_dynamic_symbol): New function.
(elf64_aarch64_finish_dynamic_sections): Call
elf_aarch64_finish_local_dynamic_symbol.
(elf64_aarch64_add_symbol_hook): New function.
* fhandler_disk_file.cc (fhandler_disk_file::pread): Skip to non-atomic
code if mandatory locking is used on this descriptor. Explain why.
(fhandler_disk_file::pwrite): Ditto.
* posix.sgml (std-notes): Extend description of file locking.
* exceptions.cc (_cygtls::handle_SIGCONT): Simplify loop waiting for
sig_handle_tty_stop to wake up. Make sure to unlock before calling
yield to avoid starvation of sig_handle_tty_stop. Add comments.
* miscfuncs.cc (yield): Explain why yield should never be called under
_cygtls::lock conditions. Call SleepEx with 1ms timeout. Explain why.
* Makefile.in: Add rule to rebuild Makefile if Makefile.in changes.
Include Makefile.dep last.
(Makefile.dep): Run xidepend within source dir. Temporarily drop
faq.xml from dependencies.
* xidepend: Fix creating base filename to accommodate VPATH.
Corinna Vinschen [Mon, 27 May 2013 19:31:04 +0000 (19:31 +0000)]
* dll_init.cc (dll_list::topsort): Fix early-return condition to
accommodate process with all runtime loaded DLLs already dlclosed
at fork time.
* gendef (_sigfe_maybe): Fix code handling early return if we don't
have a tls, broken on 2013-05-21.
Corinna Vinschen [Fri, 24 May 2013 21:12:16 +0000 (21:12 +0000)]
* Makefile.in (DEFS): Unused, remove.
(COMPILE.cc): Move -mno-use-libstdc-wrappers flag from here...
($(TEST_DLL_NAME)): ...to here since it's a link time flag.
Corinna Vinschen [Fri, 24 May 2013 13:32:10 +0000 (13:32 +0000)]
* environ.cc (win_env::add_cache): Set the Windows environment variable
using wide chars to make sure native chars don't get scrambled.
* environ.h (build_env): Fix formatting in declaration.
* pinfo.cc (pinfo::status_exit): Handle STATUS_NO_MEMORY. Explain why.
Corinna Vinschen [Thu, 23 May 2013 20:10:35 +0000 (20:10 +0000)]
* dcrt0.cc (child_info_fork::alloc_stack_hard_way): Fix datatype of
stacksize to SIZE_T. Cast to SIZE_T in pointer arithmetic. Slightly
enhance output in case of a fatal error.
* fork.cc (frok::parent): Always set ch.stackaddr to DeallocationStack
value of current thread to help stack reservation in
child_info_fork::alloc_stack_hard_way along. Simplify subsequent code
storing stack values in ch. Print guardsize in hex, too.