* child_info.h (cygheap_exec_info::sigmask): Declare new field.
* cygheap.cc (init_cygheap::find_tls): Rename threadlist_ix -> ix. Only take
one pass through thread list, looking for eligible threads to signal. Set a
new param indicating that function has found a sigwait* mask.
* cygheap.h (init_cygheap::find_tls): Reflect new parameter.
* dcrt0.cc (parent_sigmask): New variable.
(child_info_spawn::handle_spawn): Save parent's signal mask here.
(dll_crt0_1): Restore parent's signal mask to tls sigmask as appropriate. Call
sig_dispatch_pending to flush signal queue when we can finally do something
with signals.
* exceptions.cc (sigpacket::process): Avoid attempting to handle signals if we
haven't finished initializing. Rely on the fact that find_tls will do mask
checking and don't do it again. Delete ill-named 'dummy' variable.
* sigproc.cc (cygheap_exec_info::alloc): Save calling thread's signal mask in
new sigmask field.
(wait_sig): Try to debug when WFSO fails and DEBUGGING is defined.
* thread.cc (pthread::set_tls_self_pointer): Make this a true automatic method
rather than inexplicably relying on a thread parameter.
(pthread::thread_init_wrapper): Accommodate set_tls_self_pointer change to
non-static. Initialize sigmask before setting tid or suffer signal races.
* ehread.h (pthread::set_tls_self_pointer): Make non-static, delete parameter.
Corinna Vinschen [Fri, 29 Mar 2013 17:00:36 +0000 (17:00 +0000)]
* cygthread.cc (cygthread::terminate_thread): Only try to free
thread stack on systems not freeing it by themselves.
* wincap.h (wincaps::terminate_thread_frees_stack): New element.
* wincap.cc: Implement above element throughout.
* pinfo.h (pinfo::status_exit): Rename from former static function in pinfo.cc.
(pinfo::operator == (char *)): Remove unused operator.
* pinfo.cc (pinfo::status_exit): Move this function info pinfo class. Use
progname from the pinfo rather than myself. Be defensive when inspecting
procinfo.
* sigproc.cc (pending_signals::retry): Declare new element.
(pending_signals::pending): Force an additional loop through wait_sig by
setting retry whenever this function is called.
(sig_send): Reorganize to wait for SIGHOLD at bottom. Always add signal to
pending queue and work on whole queue rather than just the one signal. Loop
when sigq.retry is set. Fix long-broken check for SIGCHLD after queued
signals.
Corinna Vinschen [Wed, 27 Mar 2013 09:38:39 +0000 (09:38 +0000)]
* acconfig.h (_FVWRITE_IN_STREAMIO): Undefine.
* newlib.hin (_FVWRITE_IN_STREAMIO): Undefine.
* configure.in (--disable-newlib-fvwrite-in-streamio): New option.
* configure: Regenerated.
* libc/stdio/fputs.c (_fputs_r): Use _FVWRITE_IN_STREAMIO to
control __sfvwrite_r. Add alternative implementation.
* libc/stdio/fputws.c (_fputws_r): Ditto.
* libc/stdio/fwrite.c (_fwrite_r): Ditto.
* libc/stdio/puts.c (_puts_r): Ditto.
* libc/stdio/vfprintf.c (__ssputs_r, __sfputs_r): New function.
(_VFPRINTF_R): Use _FVWRITE_IN_STREAMIO to control vector buffer.
(__SPRINT): Use _FVWRITE_IN_STREAMIO to control macro definition.
* libc/stdio/vfwprintf.c (_VFWPRINTF_R): Use _FVWRITE_IN_STREAMIO
to control vector buffer.
Nick Clifton [Thu, 21 Mar 2013 16:08:06 +0000 (16:08 +0000)]
* elf32-h8300 (h8_relax_section): Add new relaxation of mov
@(disp:32,ERx) to mov @(disp:16,ERx).
(R_H8_DISP32A16): New reloc.
Comments added and corrected.
* reloc.c (BFD_RELOC_H8_DISP32A16): New reloc.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* ld.texinfo (H8/300): Add description of relaxation of
mov @(disp:32,ERx) to mov @(disp:16,ERx).
* ld-h8300/h8300.exp: Add new relax-7 test on ELF.
* ld-h8300/relax-2.s: Add other direction and .w/.l variants of
mov insns.
* ld-h8300/relax-2.d: Update expected disassembly.
* ld-h8300/relax-7a.s: New: tests for mov @(disp:32,ERx) -> mov
@(disp:16,ERx).
* ld-h8300/relax-7b.s: New: Likewise.
* ld-h8300/relax-7.d: New: expected disassembly.
* config/tc-h8300.c (do_a_fix_imm): Add relaxation of mov
@(disp:32,ERx) to mov @(disp:16,ERx) insns by new reloc
R_H8_DISP32A16.
* config/tc-h8300.h: Remove duplicated defines.
Nick Clifton [Wed, 20 Mar 2013 16:56:34 +0000 (16:56 +0000)]
PR gas/15082
* tic6x-opcode-table.h: Rename mpydp's specific operand type macro
from ORREGD1324 to ORXREGD1324 and make it cross-path-able through
tic6x_operand_xregpair operand coding type.
Make mpydp instruction cross-path-able, ie: remove the FIXed 'x'
opcode field, usu ORXREGD1324 for the src2 operand and remove the
TIC6X_FLAG_NO_CROSS.
* gas/tic6x/insns-bad-1.s: Remove test-case for mpydp with
cross-path.
* gas/tic6x/insns-bad-1.l: Update expected output.
* gas/tic6x/insns-c674x.s: Add a test-case for mpydp with
cross-path.
* gas/tic6x/insns-c674x.d: Update expected output.
Nick Clifton [Wed, 20 Mar 2013 16:36:34 +0000 (16:36 +0000)]
* include/opcode/tic6x.h: add tic6x_coding_dreg_(msb|lsb) field coding type in
order to encode separately the msb and lsb of a register pair ; this will be
needed to encode the opcodes the same
way as Ti assembler does.
* gas/config/tc-tic6x.c: handle tic6x_coding_dreg_(msb|lsb) field coding types
and use it to encode register pair numbers when required.
* opcodes/tic6x-dis.c: decodes opcodes that have individual msb and lsb halves
in src1 & src2 fields ; discard the src1 (lsb) value and only use src2 (msb),
discarding bit 0, to follow what Ti SDK does in that case as any value in the
src1 field yields the same output with SDK disassembler.
* include/opcode/tic6x-opcode-table.h: modify absdp, dpint, dpsp, dptrunc,
rcpdp and rsqrdp opcodes to use the new field coding types.
* gas/testsuite/gas/tic6x/insns-c674x.d, gas/testsuite/gas/tic6x/insns-c674x.s
: add test case for the newly generated opcode but keep the old ones as they
seem legit as per Ti disassembler output.
* spawn.cc (child_info_spawn::worker): Save and restore my_wr_proc_pipe around
non-execing operations to avoid handle leak seen in
http://cygwin.com/ml/cygwin/2013-03/msg00152.html .
Nick Clifton [Fri, 8 Mar 2013 17:13:31 +0000 (17:13 +0000)]
* elf-bfd.h (elfcore_write_s390_tdb): Add prototype.
* elf.c (elfcore_write_s390_tdb): New function.
(elfcore_write_register_note): Call it.
(elfcore_grok_s390_tdb): New function.
(elfcore_grok_note): Call it.
* include/sys/un.h (UNIX_PATH_MAX): Rename from UNIX_PATH_LEN to
follow Linux.
* fhandler_socket.cc: Change UNIX_PATH_LEN to UNIX_PATH_MAX throughout.
(fhandler_socket::recv_internal): Don't return prematurely in case of
successful return. For AF_LOCAL sockets, overwrite returned AF_INET
name with AF_LOCAL name.
* fhandler_socket.cc (fhandler_socket::bind): Fix check for AF_LOCAL
filename length to allow non-NUL terminated strings within namelen
bytes. Copy over sun_path to local array sun_path to have a
NUL-terminated string for subsequent function calls. Move path_conv
check before OS bind call to not bind the socket before being sure
the file doesn't exist. Add and fix comments.
Sriraman Tallam [Mon, 11 Feb 2013 19:36:56 +0000 (19:36 +0000)]
This patch assigns explicit integers to enum values corresponding
to the plugin API. This patch helps preventing problems while
cherry-picking plugin-api.h changes from trunk gold to local branches.
For instance, a linker plugin compiled with a cherry-picked
plugin-api.h header with some enum values missing will behave
strangely when used with a linker built with the up to date header.
* plugin-api.h (enum ld_plugin_level): Assign integers
explicitly for all values.
ld/
* Makefile.am (enios2elf.c): New rule.
* Makefile.in: Regenerated.
* configure.tgt: Add case for nios2*-*-*.
* emulparams/nios2elf.sh: New file.
* NEWS: Note Altera Nios II support.
binutils/
* readelf.c: Include elf/nios2.h.
(dump_relocations): Add case for EM_ALTERA_NIOS2.
(get_nios2_dynamic_type): New.
(get_dynamic_type): Add case for EM_ALTERA_NIOS2.
(is_32bit_abs_reloc): Fix EM_ALTERA_NIOS2 case.
(is_16bit_abs_reloc): Likewise.
(is_none_reloc): Add EM_ALTERA_NIOS2 and EM_NIOS32 cases.
* NEWS: Note Altera Nios II support.
* MAINTAINERS: Add Nios II maintainers.
* fhandler_socket.cc (fhandler_socket::bind): Fix length check of
AF_LOCAL filename so it never accesses memory beyond namelen. Also
make sure filename is NUL-terminated.
Nick Clifton [Mon, 28 Jan 2013 15:28:38 +0000 (15:28 +0000)]
PR gas/15069
* tic6x-opcode-table.h: Fix encoding of BNOP instruction.
* gas/tic6x/insns-c674x-pcrel.s: Add test of BNOP instruction
within header based fetch packet.
* gas/tic6x/insns-c674x-pcrel.d: Update expected disassembly.
* dcrt0.cc (dll_crt0_1): Flag that we are working "incyg". Handle any signals
(presumably exiting signals) which may have come in while we are in the process
of setting up.
Throughout, change __attribute__ ((regparm (N))) to just __regN. Throughout,
(mainly in fhandler*) start fixing gcc 4.7.2 mismatch between regparm
definitions and declarations.
* gendef: Define some functions to take @ declaration to accommodate _regN
defines which use __stdcall.
* gentls_offsets: Define __regN macros as empty.
* autoload.cc (wsock_init): Remove unneeded regparm attribute.
* winsup.h (__reg1): Define.
(__reg2): Define.
(__reg3): Define.
* advapi32.cc (DuplicateTokenEx): Coerce some initializers to avoid warnings
from gcc 4.7.2.
* exceptions.cc (status_info): Declare struct to use NTSTATUS.
(cygwin_exception::dump_exception): Coerce e->ExceptionCode to NTSTATUS.
* fhandler_clipboard.cc (cygnativeformat): Redefine as UINT to avoid gcc 4.7.2
warnings.
(fhandler_dev_clipboard::read): Ditto.
* malloc_wrapper.cc: Change 'use_internal_malloc' to 'use_internal' throughout.
(export_malloc_called): Delete.
(internal_malloc_determined): New variable.
(malloc_init): Control calculation of internal/external malloc based on
'internal_malloc_determined'. Use import_address() to determine if malloc in
user_data is ours or not.
* miscfuncs.cc (thread_wrapper): Make static.
(__import_address): Define new function.
* miscfuncs.h (import_address): New define.
(__import_address): Declare new function.
Marcus Shawcroft [Fri, 18 Jan 2013 15:52:32 +0000 (15:52 +0000)]
2013-01-18 Marcus Shawcroft <marcus.shawcroft@arm.com>
* aarch64/Machine.in (RDIMON_SCRIPTS):
Add aem-ve.specs and aem-validation.specs.
* aarch64/elf-aem-validation.specs: New file.
* aarch64/elf-aem-ve.specs: New file.