Ralf Wildenhues [Thu, 7 Jan 2010 20:00:52 +0000 (20:00 +0000)]
Sync from GCC: Makefile.tpl (BASE_TARGET_EXPORTS) fix
/:
PR bootstrap/41818
* Makefile.tpl (BASE_TARGET_EXPORTS): Only add TARGET_LIB_PATH
to $(RPATH_ENVVAR) if bootstrapping. Fix typo in comment.
* Makefile.in: Regenerate.
* cygpath.cc (main): Remove enforcing "en_US.UTF-8" locale.
Revert usage of argz functions when reading input from file and
simplify option usage. Allow only one option argument and use
the rest as filename argument to allow spaces in filenames. Restrict
processing special folder type options to one line.
* dcrt0.cc (dll_crt0_1): Move internal locale setting prior to potential
globify to prevent creation of unglobbed filenames in the wrong character set.
Corinna Vinschen [Mon, 28 Dec 2009 17:24:03 +0000 (17:24 +0000)]
* fhandler.h (fhandler_socket::wait_for_events): Drop parameter default
value.
* fhandler_socket.cc (fhandler_socket::connect): Add false as second
parameter to wait_for_events call.
(fhandler_socket::accept): Ditto.
(fhandler_socket::send_internal): Fix typo in call to wait_for_events.
Corinna Vinschen [Mon, 21 Dec 2009 15:16:28 +0000 (15:16 +0000)]
* exec.cc (execvp): Call find_exec with FE_NNF flag to enforce
a NULL return when executable isn't found in $PATH. Convert NULL
to "".
(execvpe): Ditto.
* spawn.cc (spawn_guts): Return with EFAULT if prog_arg is NULL.
Return with ENOENT if prog_arg is empty string. Add a comment.
Corinna Vinschen [Mon, 21 Dec 2009 10:11:27 +0000 (10:11 +0000)]
* fhandler_console.cc (get_nonascii_key): Generate ESC prefix
for Alt modifier generically for function keys and keypad keys.
Distinguish Normal, Ctrl, Shift, Ctrl-Shift rather
than Normal, Ctrl, Shift, Alt, so that in combination with generic
Alt handling all 8 combinations of these modifiers are distinguished.
(keytable): Add escape sequences for remaining modified
function keys as a compatible extension using rxvt escape codes.
Also distinguish keypad keys modified with Ctrl, Shift, Ctrl-Shift
using xterm-style modifier coding.
Corinna Vinschen [Mon, 21 Dec 2009 09:38:25 +0000 (09:38 +0000)]
Throughout, revert ill-conceived replacement of hMainThread with
GetCurrentThread/NtCurrentThread.
* dcrt0.cc (dll_crt0_0): Duplicate main thread handle to hMainThread
again.
Corinna Vinschen [Sat, 19 Dec 2009 15:37:10 +0000 (15:37 +0000)]
* fhandler_console.cc (write_console): Check for VT100
graphics mode and transform wide characters in ASCII small
letter range to corresponding graphics.
(__vt100_conv): Table to transform small ASCII letters to line
drawing graphics for use in VT100 graphics mode.
(write_normal): Check for SO/SI control characters to
enable/disable VT100 graphics mode.
(base_chars): Enable SO/SI control characters for detection.
(write): Check for ESC ( 0 / ESC ( B escape sequences to
enable/disable VT100 graphics mode. Also detect ">" while
parsing ESC [ sequences to distinguish specific requests.
(char_command): Distinguish Secondary from Primary Device Attribute
request to report more details about cygwin console terminal version.
* fhandler.h (vt100_graphics_mode_active): New flag to indicate mode.
(saw_greater_than_sign): New parse flag for ESC [ > sequences.
(gotparen, gotrparen): New state values to parse ESC ( / ) sequences.
* fhandler_console.cc (read): Allow combined Alt-AltGr modifiers
to also produce an ESC prefix like a plain Alt modifier, e.g. to make
Alt-@ work on a keyboard where @ is AltGr-q.
Corinna Vinschen [Fri, 18 Dec 2009 20:32:04 +0000 (20:32 +0000)]
Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcess
according to context. Throughout, replace hMainThread with
GetCurrentThread/NtCurrentThread according to context.
* dcrt0.cc (dll_crt0_0): Drop duplication of GetCurrentProcess to
hMainProc. Drop duplication of GetCurrentThread to hMainThread.
* dtable.cc (dtable::stdio_init): Remove useless comment.
* globals.cc (hMainProc): Remove.
(hMainThread): Remove.
* ntdll.h (NtCurrentProcess): Define.
(NtCurrentThread: Define.
Corinna Vinschen [Fri, 18 Dec 2009 17:14:21 +0000 (17:14 +0000)]
* fhandler.h (fhandler_registry::value_name): Convert to wchar_t*.
* fhandler_registry.cc: Call UNICODE registry functions throughout
and convert to multibyte using current locale's charset. Accommodate
throughout.
(must_encode): Take wchar_t.
(encode_regname): Convert from wchar_t *.
(decode_regname): Convert to wchar_t *.
Jeff Johnston [Thu, 17 Dec 2009 20:04:43 +0000 (20:04 +0000)]
2009-12-17 Jerker Back <jerker.back@gmail.com>
* libc/iconv/lib/local.h[!__GNUC__]: Add alternative version of
ICONV_ZERO_MB_STATE_T macro.
* libc/iconv/lib/ucsconv.c (ucs_based_conversion_get_state): Use
temporary local variable nullstate to hold empty mbstate_t.
Jeff Johnston [Thu, 17 Dec 2009 19:43:43 +0000 (19:43 +0000)]
2009-12-17 Jerker Back <jerker.back@gmail.com>
* libc/include/_ansi.h: Add new _EXFNPTR macro for using with
function pointer arguments.
* libc/iconv/lib/conv.h: Use _EXFNPTR rather than _EXPARM macro.
* libc/iconv/lib/ucsconv.h: Ditto.
* libc/include/stdlib.h: Use new _EXFNPTR macro for function pointers.
* libc/include/sys/reent.h: Ditto.
* libc/include/sys/unistd.h: Ditto.
* libc/search/bsearch.c: Ditto.
* libc/stdio/fseek.c: Ditto.
* libc/stdio64/fseeko64.c: Ditto.
* libc/stdlib/atexit.c: Ditto.
* libc/stdlib/on_exit.c: Ditto.
Corinna Vinschen [Thu, 17 Dec 2009 18:33:05 +0000 (18:33 +0000)]
* syscalls.cc (try_to_bin): Handle remote shares as well. Just rename
files in this case, instead of moving them to the recycler. Create
even more unique filename. Add comment to explain filename.
(unlink_nt): Remove code returning with EBUSY on remote shares.
Set bin_stat to move_to_bin except on NFS. Add comment to explain.
Alan Modra [Thu, 17 Dec 2009 05:45:25 +0000 (05:45 +0000)]
PR ld/11088
include/elf/
* ppc.h (R_PPC_RELAX32, R_PPC_RELAX32PC, R_PPC_RELAX32_PLT,
R_PPC_RELAX32PC_PLT): Delete.
(R_PPC_RELAX, R_PPC_RELAX_PLT, R_PPC_RELAX_PLTREL24): Define.
bfd/
* elf32-ppc.c (update_plt_info): Clear sec here when addend is
less than 32768..
(ppc_elf_check_relocs): ..rather than doing so here. Ignore new
relax relocs.
(ppc_elf_gc_sweep_hook): Don't segfault when symbol hiding has
removed plt_entry records.
(ppc_elf_tls_setup): Handle PIE calls to __tls_get_addr correctly.
(ppc_elf_tls_optimize): Likewise. Also dec __tls_get_addr refcount
when optimizing code using new tlsgd and tlsld marker relocs.
(ppc_elf_relax_section): Differentiate relaxed PLTREL24 relocs
from ADDR24 relocs using plt or glink. Don't clear the addend
for R_PPC_RELAX_PLTREL24.
(ppc_elf_relocate_section): Correctly handle addends on relaxed
PLTREL24 relocs.
Corinna Vinschen [Wed, 16 Dec 2009 14:56:10 +0000 (14:56 +0000)]
* fhandler_console.cc (read): Detect and handle mouse wheel scrolling
events (for completion of mouse reporting mode 1000) and mouse
movement events (for additional mouse reporting modes 1002 and 1003).
Use mouse_aware() as a guard and only condition for mouse
reporting in order to enforce consistence of read() and select().
Add focus reports (for additional focus reporting mode 1004).
(mouse_aware): Enable detection of additional mouse events for select().
Tune function to precisely match actual reporting criteria.
Move adjustment of mouse position (by window scroll offset)
here to avoid duplicate code.
(char_command): Initialization of enhanced mouse reporting modes.
Initialization of focus reporting mode.
* fhandler.h (use_mouse): Change flag (bool->int) to indicate
additional mouse modes. Add flag to indicate focus reporting.
(mouse_aware): Move enhanced function into fhandler_console.cc.
* select.cc (peek_console): Use modified mouse_aware() for more
general detection of mouse events. Also check for focus reports.
Corinna Vinschen [Wed, 16 Dec 2009 14:02:57 +0000 (14:02 +0000)]
* regtool.cc: Throughout, convert all registry calls to wide char
calls and use string conversion according to current locale.
(longopts): Change "dword-le" to "dword-be", as was originally
intended.
(usage): Change usage accordingly.
(print_version): Simplify copyright dates in output.
(cmd_list): Handle REG_LINK like REG_SZ.
(cmd_get): Ditto.
(main): Call setlocale.
* utils.sgml (regtool): Fix options and add missing descriptions for
new features.
Corinna Vinschen [Tue, 15 Dec 2009 12:46:40 +0000 (12:46 +0000)]
* fhandler_console.cc (char_command): Fix code to select dim mode
to 2 rather than 9. Add entries for mode 22 (normal, not bold)
28 (visible, not invisible), 25 (not blinking).
Corinna Vinschen [Mon, 14 Dec 2009 10:47:25 +0000 (10:47 +0000)]
* libc/getopt.c (getopt_internal): Set optreset according to optind
setting earlier. Reevaluate POSIXLY_CORRECT if optreset is set to !0.
Handle a leading '-' in options independently of posixly_correct.
* fhandler_fifo.cc (fhandler_fifo::open): Avoid resetting errno after it has
been explicitly set.
* include/cygwin/version.h: Bump DLL minor version number to 2.
Nick Clifton [Wed, 2 Dec 2009 14:04:15 +0000 (14:04 +0000)]
PR binutils/11017
* dlltool.c (PAGE_SIZE): Delete.
(PAGE_MASK): Provide default definition based on COFF_PAGE_SIZE.
Check for DLLTOOL_DEFAULT_MX86_64 and DLLTOOL_DEFAULT_I386.
* coff-i386.h (COFF_PAGE_SIZE): Definition moved to coff/i386.h
Corinna Vinschen [Thu, 26 Nov 2009 10:58:06 +0000 (10:58 +0000)]
* dtable.cc (dtable::stdio_init): Use GetCurrentProcess() rather than
hMainProc as process handle when duplicating the stdout handle.
Explain why. Add Win32 error code to debug output.
Corinna Vinschen [Mon, 23 Nov 2009 17:02:20 +0000 (17:02 +0000)]
Use NetBSD fix for CVE-2009-0689 security vulnerability.
* libc/include/sys/reent.h (_Kmax): Define here based on the sizeof
size_t, as in latest NetBSD.
* libc/reent/reent.c (_reclaim_reent): Use _Kmax rather than constant
value 15.
* libc/stdlib/mprec.c (_Kmax): Don't define here. Explain why.
Corinna Vinschen [Mon, 23 Nov 2009 14:50:14 +0000 (14:50 +0000)]
* fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Add
socket handle value to debug output.
(fhandler_socket::fixup_after_fork): Ditto. Make new socket handle
OVERLAPPED, just as if it has been created with socket().
* net.cc (fdsock): Close duplicated socket and explain why. Disable
the entire WSADuplicateSocket test for now and explain why.