summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix up errors in regenerated files for 2.3.0 release.newlib-snapshot-20160104Jeff Johnston2016-01-044-3223/+4941
|
* setfacl: Remove unused local variableCorinna Vinschen2015-12-252-1/+5
| | | | | | * setfacl.cc (delacl): Remove unused local variable. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Only request WRITE_DAC rights when writing an ACLCorinna Vinschen2015-12-252-2/+8
| | | | | | | | * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Only request query_write_dac rather than query_write_control access when writing an ACL. Fix a comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* aclsort: Honor calclass argument and allow recalculating ACL mask.Corinna Vinschen2015-12-242-1/+26
| | | | | | | * sec_acl.cc (__aclcalcmask): New function to recalculate ACL masks. (aclsort32): Honor calclass argument. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* aclfromtext: Actually return aclcnt parameterCorinna Vinschen2015-12-242-2/+10
| | | | | | * sec_acl.cc (aclfromtext32): Return missing aclcnt parameter. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Use TLS buffer in ACL<->text conversionCorinna Vinschen2015-12-242-4/+11
| | | | | | | * sec_acl.cc (acltotext32): Use tmp_pathbuf rather than stack buffer. (aclfromtext32): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* sec_acl.cc: Cosmetic changesCorinna Vinschen2015-12-242-14/+18
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Regenerate files for newlib 2.3.0.newlib-2_3_0Jeff Johnston2015-12-21105-6166/+4598
|
* setfacl(1): Fix handling of -m and -x on a single commandlineCorinna Vinschen2015-12-212-9/+28
| | | | | | | | * setfacl.cc (delace): New helper function to delete a single ACE. (delacl): Call delace. (modacl): Ditto, if entry is supposed to get deleted. Align comments. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix atexit logic to honor _ATEXIT_DYNAMIC_ALLOC setting.Jeff Johnston2015-12-212-0/+12
| | | | | | | | | | | | | If small reent is enabled (_REENT_SMALL is defined) then malloc() was used in __register_exitproc() even if user requested it to be disabled (_ATEXIT_DYNAMIC_ALLOC is defined). With this fix, function fails when _ATEXIT_DYNAMIC_ALLOC is defined and whole static storage is already used. 2015-12-21 Freddie Chopin <freddie.chopin@gmail.com> * libc/stdlib/__atexit.c (__register_exitproc): Fix for _ATEXIT_DYNAMIC_ALLOC.
* Add static instance of _on_exit_args for _REENT_SMALL platforms.Jeff Johnston2015-12-218-23/+108
| | | | | | | | | | | | | 2015-12-21 Freddie Chopin <freddie.chopin@gmail.com> * libc/stdlib/on_exit_args.{c,h}: New files. * libc/stdlib/Makefile.am: Add new source file. * libc/stdlib/Makefile.in: Regenerate. * libc/stdlib/__atexit.c (__register_exitproc): Initialize _on_exit_args_ptr field of _GLOBAL_ATEXIT on first run. * libc/stdlib/on_exit.c: Force linking of static instance of _on_exit_args. * libc/stdlib/cxa_atexit.c: Likewise.
* setfacl(1): Rewrite support for mask recomputationCorinna Vinschen2015-12-216-37/+78
| | | | | | | | | | | | | | | | * setfacl.cc (modacl): Move recomputing mask into new function. (check_got_mask): New function checking if mask is in input. (recompute_mask): New function to recompute mask. (addmissing): Align mask computation to Linux setfacl. (setfacl): Call check_got_mask and recompute_mask on Set, Delete and Modify actions. (usage): Rename --substitute to --set. (longopts): Add --set option. * utils.xml (setfacl): Rename --substitute to --set. * new-features.xml (ov-new2.4): Rephrase setfacl changes. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* setfacl --mask/--no-mask really don't need an argumentHouder2015-12-202-2/+7
| | | | | | | * setfacl.cc (longopts): Drop accidentally requiring an argument to the --mask and --no-mask options. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix missing arg requirement for setfacl -x optionHouder2015-12-192-1/+5
| | | | | | * setfacl.cc (opts): Add colon to x option. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop sys_cp_wcstombs and save two arguments per callCorinna Vinschen2015-12-184-14/+12
| | | | | | | | | * strfuncs.cc (sys_cp_wcstombs): Delete and move functionality into sys_wcstombs. * wchar.h (sys_cp_wcstombs): Drop declaration. * fhandler_console.cc (dev_console::con_to_str): Call sys_wcstombs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Build msp430-specific libnosysDJ Delorie2015-12-174-6/+12
| | | | | | | | | | The MSP430 debuggers support I/O on hardware through CIO, so we can use a CIO-enabled library as the "nosys" library (in addition to the libsim library, which talks to our simulator) * configure.in: Don't build default libnosys for msp430 * configure: Regenerate. * msp430/Makefile: Rename libcio to libnosys.
* ARC: Use new definitions for optional ARC CPU featuresAnton Kolesov2015-12-1724-69/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC for ARC has been updated to provide consistent naming of preprocessor definitions for different optional architecture features: * __ARC_BARREL_SHIFTER__ instead of __Xbarrel_shifter for -mbarrel-shifter * __ARC_LL64__ instead of __LL64__ for -mll64 * __ARCEM__ instead of __EM__ for -mcpu=arcem * __ARCHS__ instead of __HS__ for -mcpu=archs * etc (not used in newlib) This patch updates assembly routines for ARC to use new definitions instead of a deprecated ones. To ensure compatibility with older compiler new definitions are also defined in asm.h if needed, based on deprecated preprocessor definitions. *** newlib/ChangeLog *** 2015-12-15 Anton Kolesov <Anton.Kolesov@synopsys.com> * libc/machine/arc/asm.h: Define new GCC definition for old compiler. * libc/machine/arc/memcmp-bs-norm.S: Use new GCC defines to detect processor features. * libc/machine/arc/memcmp.S: Likewise. * libc/machine/arc/memcpy-archs.S: Likewise. * libc/machine/arc/memcpy-bs.S: Likewise. * libc/machine/arc/memcpy.S: Likewise. * libc/machine/arc/memset-archs.S: Likewise. * libc/machine/arc/memset-bs.S: Likewise. * libc/machine/arc/memset.S: Likewise. * libc/machine/arc/setjmp.S: Likewise. * libc/machine/arc/strchr-bs-norm.S: Likewise. * libc/machine/arc/strchr-bs.S: Likewise. * libc/machine/arc/strchr.S: Likewise. * libc/machine/arc/strcmp-archs.S: Likewise. * libc/machine/arc/strcmp.S: Likewise. * libc/machine/arc/strcpy-bs-arc600.S: Likewise. * libc/machine/arc/strcpy-bs.S: Likewise. * libc/machine/arc/strcpy.S: Likewise. * libc/machine/arc/strlen-bs-norm.S: Likewise. * libc/machine/arc/strlen-bs.S: Likewise. * libc/machine/arc/strlen.S: Likewise. * libc/machine/arc/strncpy-bs.S: Likewise. * libc/machine/arc/strncpy.S: Likewise. Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
* Remove inclusion of sys/select.h in sys/types.h for backward compatCorinna Vinschen2015-12-172-2/+4
| | | | | | * libc/include/sys/types.h: Remove including <sys/select.h>. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Update CIO hooks to be more flexible.DJ Delorie2015-12-172-9/+21
| | | | | | | Replace the one hook we had with two to avoid underscore issues. * msp430/cio.c: Remove, replace with... * msp430/cio.S: New, this.
* rl78: Don't output CR when LF is encountered in write().Kevin Buettner2015-12-162-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file libgloss/rl78/write.c currently contains code which outputs \r when \n is seen. The code will then output the \n as well. This patch removes the bit of code that tests for \n and then outputs \r. I made this change to fix some failures in gdb.base/call-ar-st.exp. In that test, I see two carriage returns followed by a newline. One CR is output by the libgloss code. The other is output by the terminal driver. The total list of failures fixed (using the default rl78 multilib) are: FAIL: gdb.base/call-ar-st.exp: print print_double_array(double_array) (timeout) FAIL: gdb.base/call-ar-st.exp: print print_char_array(char_array) (timeout) FAIL: gdb.base/call-ar-st.exp: continue to tbreak2 (timeout) FAIL: gdb.base/call-ar-st.exp: continuing to tbreak3 (timeout) FAIL: gdb.base/call-ar-st.exp: print print_double_array(array_d) (timeout) FAIL: gdb.base/call-ar-st.exp: continuing to tbreak4 (timeout) FAIL: gdb.base/call-ar-st.exp: print sum_array_print(10, *list1, *list2, *list3, *list4) (timeout) FAIL: gdb.base/call-ar-st.exp: print print_small_structs (timeout) FAIL: gdb.base/call-ar-st.exp: print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065) (timeout) FAIL: gdb.base/call-ar-st.exp: print print_small_structs from print_long_arg_list (timeout) FAIL: gdb.base/call-ar-st.exp: print print_struct_rep(*struct1, *struct2, *struct3) (timeout) FAIL: gdb.base/dprintf.exp: call: printf: 1st dprintf (timeout) FAIL: gdb.base/dprintf.exp: call: printf: 2nd dprintf (timeout) FAIL: gdb.base/interrupt.exp: process is alive (the program exited) There are no regressions. libgloss/ChangeLog: * rl78/write.c (_write): Don't output CR when LF is encountered.
* Add release message for previous commitCorinna Vinschen2015-12-161-0/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix crash reading invalid SIDs from passwd and group filesCorinna Vinschen2015-12-163-4/+9
| | | | | | | * grp.cc (pwdgrp::parse_group): Only copy the SID if it's valid. * passwd.cc (pwdgrp::parse_passwd): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add usertemp to 2.4.0 release textCorinna Vinschen2015-12-151-0/+3
|
* Add _REENT_INIT_PTR_ZEROED()Sebastian Huber2015-12-142-6/+14
| | | | | | | | Provide a _REENT_INIT_PTR_ZEROED() macro to initialize an already zero-initialized struct _reent. * libc/include/sys/reent.h (_REENT_INIT_PTR_ZEROED): New. (_REENT_INIT_PTR): Define only once and use _REENT_INIT_PTR_ZEROED().
* FreeBSD compatibility for <sys/select.h>Sebastian Huber2015-12-148-23/+74
| | | | | | | | | | | | * libc/include/sys/_sigset.h: New. * libc/include/sys/select.h: Do not include <sys/types.h> and <sys/time.h> to avoid cyclic header file dependencies. Include specialized header files instead. (sigset_t): Conditionally define. * libc/include/sys/signal.h (sigset_t): Likewise. * libc/include/sys/time.h: Include <sys/select.h> if __BSD_VISIBLE. * libc/include/sys/types.h: Likewise.
* Add missing lock releases in __register_exitproc().Freddie Chopin2015-12-142-1/+14
| | | | | | | | In some code paths the __atexit_lock held by this function was not released when returning with an error. * libc/stdlib/__atexit.c (__register_exitproc): Always release lock before return.
* Fix regparm attribute of fhandler_base::fstat_helperKen Brown2015-12-142-1/+6
| | | | | * winsup/cygwin/fhandler_disk_file.cc (fhandler_base::fstat_helper): Align regparm attribute to declaration in fhandler.h.
* Fetch and store FileAllInformation rather than FileNetworkOpenInformationCorinna Vinschen2015-12-105-119/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * path.h (class path_conv_handle): Use FILE_ALL_INFORMATION instead of FILE_NETWORK_OPEN_INFORMATION. Use definitions from ntdll.h since it's included anyway. (path_conv_handle::fai): Change name from fnoi. (path_conv::fai): Ditto. (file_get_fai): Change name from file_get_fnoi. Drop second parameter. * path.cc (file_get_fai): Ditto. Fetch FileAllInformation rather than FileNetworkOpenInformation. Convert STATUS_BUFFER_OVERFLOW to STATUS_SUCCESS. Remove workaround to fetch FileBasicInformation and FileStandardInformation on filesystems with broken FileNetworkOpenInformation handling. (symlink_info::check): Accommodate above changes. In case of using the NtQueryDirectoryFile fallback, fetch FileIdBothDirectoryInformation to get inode number as well. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop outdated comment. Accommodate change to using FileAllInformation. Drop extra function calls to fetch NumberOfLinks and IndexNumber. Set ino directly from IndexNumber stored in pc.fai(). Drop second argument from call to fstat_helper. (fhandler_base::fstat_by_name): Drop second argument from call to fstat_helper. (fhandler_base::fstat_helper): Drop second parameter. Accommodate the fact that we access a FILE_ALL_INFORMATION structure now. (fhandler_base::open_fs): Set ino directly from IndexNumber stored in pc.fai(). * fhandler.h (fhandler_base::fstat_helper): Fix declaration accrdingly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop unused path_conv::ndisk_links methodCorinna Vinschen2015-12-093-89/+5
| | | | | | | * fhandler_disk_file.cc (path_conv::ndisk_links): Drop unused method. (fhandler_base::fstat_helper): Drop unused call to ndisk_links. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Use fii instead of fai for FILE_INTERNAL_INFORMATION varsCorinna Vinschen2015-12-092-8/+14
| | | | | | | | * fhandler_disk_file.cc (path_conv::get_ino_by_handle): Rename fai to fii for clearness. (fhandler_disk_file::readdir): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* In FILE_ID_BOTH_DIR_INFORMATION it's actually FileId, not IndexNumberCorinna Vinschen2015-12-093-3/+9
| | | | | | | | * ntdll.h (FILE_ID_BOTH_DIR_INFORMATION): Revert IndexNumber to FileId since it's actually right here. * fhandler_disk_file.cc: Accommodate above change. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Check for 64 FP instructions availability in libm before using themThomas Preud'homme2015-12-097-6/+16
| | | | | | | | | | | | Currently, double precision math functions in newlib/libm/machine/arm detect whether neon instructions can be used for double precision computation by checking the architecture version (>= 8) and the availability of floating-point instructions. However, these instructions would not be available if targeting fpv5-sp-d16 as the FPU, which by definition does not have 64bit float instructions. This patch adds a check that __ARM_FP advertises 64bit float instructions. * libm/machine/arm/s_ceil.c: Also check that 64bit FP instructions are available in the guard. * libm/machine/arm/s_floor.c: Likewise. * libm/machine/arm/s_nearbyint.c: Likewise. * libm/machine/arm/s_rint.c: Likewise. * libm/machine/arm/s_round.c: Likewise. * libm/machine/arm/s_trunc.c: Likewise.
* Add missing checks for __SNLK flagCorinna Vinschen2015-12-085-15/+39
| | | | | | | | | | | * libc/stdio/fclose.c (_fclose_r): Make _flockfile/_funlockfile calls dependent on __SNLK flag. * libc/stdio/findfp.c (__fp_lock): Ditto. (__fp_unlock): Ditto. * libc/stdio/freopen.c (_freopen_r): Ditto. * libc/stdio64/freopen64.c (_freopen64_r): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix re-initialization of FILE flags and mbstate in freopenCorinna Vinschen2015-12-083-1/+10
| | | | | | | | * libc/stdio/freopen.c (_freopen_r): Only reset __SWID bit per SUSv4. * libc/stdio64/freopen64.c (_freopen64_r): Add missing resetting of flag values and _mbstate. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Remove unnecessary locking in pthread_setcancelstate/pthread_setcanceltypeCorinna Vinschen2015-12-082-26/+15
| | | | | | | * thread.cc (pthread::setcancelstate): Remove unnecessary locking. (pthread::setcanceltype): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Rename FileId to IndexNumber in NT structures to align with upstreamCorinna Vinschen2015-12-084-12/+20
| | | | | | | | | | * ntdll.h (FILE_ID_BOTH_DIR_INFORMATION): Rename FileId to IndexNumber to align with Microsoft naming scheme. (FILE_INTERNAL_INFORMATION): Ditto. * fhandler_disk_file.cc: Rename FileId to IndexNumber throughout. * syscalls.cc: Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix minor style issue in _dll_crt0.Corinna Vinschen2015-12-071-1/+1
| | | | | | Fix missing space. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Introduce the 'usertemp' filesystem typeJohannes Schindelin2015-12-075-4/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mount.cc (mount_info::from_fstab_line): Support mounting the current user's temp folder as /tmp/. This is particularly useful a feature when Cygwin's own files are write-protected. * pathnames.xml: document the new usertemp file system type Detailed explanation: In the context of Windows, there is a per-user directory for temporary files, by default specified via the environment variable %TEMP%. Let's allow to use that directory for our /tmp/ directory. With this patch, we introduce the special filesystem type "usertemp": By specifying none /tmp usertemp binary,posix=0 0 0 in /etc/fstab, the /tmp/ directory gets auto-mounted to the directory specified by the %TEMP% variable. This feature comes handy in particularly in scenarios where the administrator might want to write-protect the entire Cygwin directory yet still needs to allow users to write into the /tmp/ directory. This is the case in the context of Git for Windows, where the Cygwin (MSys2) root directory lives inside C:\Program Files and hence /tmp/ would not be writable otherwise. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* Add definitions for NBBY to arm and rtems targetsNick Withers2015-12-073-0/+9
| | | | | | | * libc/sys/arm/sys/param.h (NBBY): Define if not already defined. * libc/sys/rtems/include/sys/param.h (NBBY): Define. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Move fd_stuff from sys/types.h to sys/select.hCorinna Vinschen2015-12-0711-96/+122
| | | | | | | | | | | | | | | | | | * libc/include/sys/types.h: Move definitions of NBBY and howmany to sys/param.h. Move definitions of select(2) macros to sys/select.h. * libc/include/sys/param.h: See above. * libc/include/sys/select.h: Move Cygwin's sys/select.h here. * include/sys/select.h: Move select(2) macros from newlib's sys/types.h here. Rename howmany to _howmany to unclutter namespace. Move file to newlib. * libc/rexex.cc: Add declaration for cygwin_gethostname. * poll.cc: Include sys/param.h and locale select.h. * select.h (cygwin_select): Declare. * uname.cc: Declare cygwin_gethostname. * winsup.h: Drop declarations of cygwin_select and cygwin_gethostname. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Always allocate main thread stack from pthread stack area on x86_64.Corinna Vinschen2015-12-078-79/+96
| | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc: Semi-revert commit 12743c2d5d2721f3a80b4d7671a349be03c1f520. (dll_crt0_0): Drop setting wow64_needs_stack_adjustment on 64 bit. (_dll_crt0): Split out 64 bit code again and always create new main thread stack, unless forked off from the non main thread in the parent. Call create_new_main_thread_stack with parent stack commitsize if started from the parent's main thread. Only call child_info_fork::alloc_stack for the latter case on 64 bit. Slightly rearrange moving rsp and rbp to new stack and document how. Revert 32 bit wow64 handling to its former self. * miscfunc.cc (create_new_main_thread_stack): Take a commitsize parameter and use it if it's not 0. Don't set _main_tls here, it's done in the caller _dll_crt0 anyway. Return stackbase - 16 bytes, rather than stacklimit (which was very wrong anyway). * miscfuncs.h (create_new_main_thread_stack): Accommodate declaration to aforementioned change. * wincap.h (wincaps::has_3264_stack_broken): Remove element. * wincap.cc: Ditto, throughout. * wow64.cc: Semi-revert to pre-12743c2d5d2721f3a80b4d7671a349be03c1f520 but keep architecture-agnostic type changes intact. Fix formatting. * wow64.h: Revert to pre-12743c2d5d2721f3a80b4d7671a349be03c1f520. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Allow cygwin_conv_path(3) and cygpath(1) to emit /proc/cygdrive prefixed pathCorinna Vinschen2015-12-0613-45/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/sys/cygwin.h (CCP_PROC_CYGDRIVE): New flag. * mount.cc (mount_info::cygdrive_posix_path): Take flag values rather than just a trailing_slash_p bool. Emit /proc/cygdrive path if CCP_PROC_CYGDRIVE flag is given. (mount_info::conv_to_posix_path): Take flag values rather than just a keep_rel_p bool. Rename _p variables. Print flag value as hex in debug_printf. Call cygdrive_posix_path with flag values. * mount.h (mount_info::cygdrive_posix_path): Accommodate above change in declaration. (mount_info::conv_to_posix_path): Ditto. * fhandler_process.cc (format_process_exename): Accommodate change to mount_info::conv_to_posix_path. * path.cc (cygwin_conv_path): Ditto. * cygpath.cc (absolute_flag): Initialize to CCP_RELATIVE to simplify expressions. (cygdrive_flag): New global flag. (long_options): Add --proc-cygdrive option. (options): Add -U option. (usage): Add description for -U option. (do_sysfolders): Or cygdrive_flag to cygwin_conv_path call. (do_pathconv): Simply or absolute_flag to conv_func. Or cygdrive_flag to conv_func. (do_options): Initalize absolute_flag to CCP_RELATIVE. Initialize new cygdrive_flag. Set absolute_flag to CCP_ABSOLUTE on -a. Set cygdrive_flag to CCP_PROC_CYGDRIVE on -U. * new-features.xml (ov-new2.4): Document cygpath -U option. * utils.xml (cygpath): Ditto. * path.xml (func-cygwin-path): Add CCP_PROC_CYGDRIVE description. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Always define __high_bsssize, do not just PROVIDE it.Nick Clifton2015-12-042-2/+6
| | | | * msp430/msp430xl-sim.ld (__high_bsssize): Define.
* Add release message for workaround added with previous commitsCorinna Vinschen2015-12-031-0/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* On 64 bit, only create new thread stack if started from 32 bit process on ↵Corinna Vinschen2015-12-036-60/+90
| | | | | | | | | | | | | | | | | | | | | | affected platforms * dcrt0.cc (dll_crt0_0): On 64 bit, set wow64_needs_stack_adjustment if not started from a 64 bit process. (_dll_crt0): Enable wow64_needs_stack_adjustment branch on 64 bit as well. Remove 64 bit only code. Introduce CREATE_STACK and FIX_STACK macros to conditionalize the code. Rearrange and partially rewrite comments. * wincap.h (wincaps::has_3264_stack_broken): New element. * wincap.cc: Implement above element throughout. (wincapc::init): Set has_3264_stack_broken to false on 32 bit. * wow64.cc: Enable functionality on 64 bit architecture, except for wow64_revert_to_original_stack. Enhance comments to explain. (wow64_eval_expected_main_stack): Make 64 bit clean. (wow64_test_for_64bit_parent): Ditto. * wow64.h: Export wow64_revert_to_original_stack on 32 bit only, everything else on all architectures. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix thinko in /proc/<PID>/maps TEB detection on W10 1511Corinna Vinschen2015-12-032-26/+60
| | | | | | | | | | | * fhandler_process.cc (thread_info::thread_info): Accommodate the fact that TEBs take two pages. (thread_info::fill_if_match): Rewrite the method for post W10 1511 TEB detection. (format_process_maps): Add a state member to region. Fix the code to handle PEB/TEB region since W10 1511. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix /proc/<PID>/maps output for PEB and TEBs on W10 1511Corinna Vinschen2015-12-035-10/+113
| | | | | | | | | | | | | | | | * fhandler_process.cc (heap_info::fill_if_match): Return NULL, not 0. (thread_info::fill_if_match): Ditto. (thread_info::fill_if_match): New method to extract TEB info from PEB/TEB region since W10 1511. (format_process_maps): Drop outdated FIXME comment. Add code to handle PEB/TEB region since W10 1511. * mmap.cc (posix_madvise): Align comment to new W10 1511 version. * wincap.h (wincaps::has_new_pebteb_region): New element. * wincap.cc: Implement above element throughout. (wincap_10_1511): New global wincaps to support Windows 10 since 1511. (wincapc::init): Use wincap_10_1511 for W10 builds >= 10586. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Always move 64 bit main thread stack to defined pthread stack areaCorinna Vinschen2015-12-034-0/+83
| | | | | | | | | | | x86_64 only: * dcrt0.cc (_dll_crt0): Always move stack to pthread stack area. Explain why. * miscfuncs.cc (create_new_main_thread_stack): New function to create OS-like stack for main thread in pthread stack area. * miscfuncs.cc (create_new_main_thread_stack): Declare. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cleanup in dcrt0.cc and fork.ccCorinna Vinschen2015-12-033-6/+12
| | | | | | | | * dcrt0.cc (child_info_fork::alloc_stack): Fix formatting. * fork.cc (frok::parent): Fix formatting. (child_copy): Change type of res to BOOL. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Always restore full TEB stack info in forkeeCorinna Vinschen2015-12-032-9/+14
| | | | | | | * dcrt0.cc (dll_crt0_1): Always restore the TEB stack info. Especially restore DeallocationStack. Fix comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>