aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/pseudo-reloc.cc
AgeCommit message (Collapse)AuthorFilesLines
2015-07-19Reduce stack pressure throughout CygwinCorinna Vinschen1-5/+3
* dcrt0.cc (initial_env): Reduce size of local path buffers to PATH_MAX. Allocate debugger_command from process heap. (init_windows_system_directory): Very early initialize new global variable global_progname. * dll_init.cc (dll_list::alloc): Make path buffer static. Explain why. (dll_list::populate_deps): Use tmp_pathbuf for local path buffer. * exceptions.cc (debugger_command): Convert to PWCHAR. (error_start_init): Allocate debugger_command and fill with wide char strings. Only allocate if NULL. (try_to_debug): Just check if debugger_command is a NULL pointer to return. Drop conversion from char to WCHAR and drop local variable dbg_cmd. * globals.cc (global_progname): New global variable to store Windows application path. * pinfo.cc (pinfo_basic::pinfo_basic): Just copy progname over from global_progname. (pinfo::status_exit): Let path_conv create the POSIX path to avoid local buffer. * pseudo_reloc.cc (__report_error): Utilize global_progname, drop local buffer. * smallprint.cc (__small_vsprintf): Just utilize global_progname for %P format specifier. (__small_vswprintf): Ditto. * strace.cc (PROTECT): Change to reflect x being a pointer. Reformat. (CHECK): Ditto. Reformat. (strace::activate): Utilize global_progname, drop local buffer. Fix formatting. (strace::vsprntf): Reduce size of local progname buffer to NAME_MAX. Copy and, if necessary, convert only the last path component to progname. (strace_buf_guard): New muto. (buf): New static pointer. (strace::vprntf): Use buf under strace_buf_guard lock only. Allocate buffer space for buf on Windows heap. * wow64.cc (wow64_respawn_process): Utilize global_progname, drop local path buffer. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2014-05-19 * pseudo-reloc.cc (__report_error): Raise size of module name buffer toCorinna Vinschen1-2/+2
PATH_MAX. Fix length in call to GetModuleFileNameW (CID 59947).
2013-04-23 * Merge in cygwin-64bit-branch.Corinna Vinschen1-3/+9
2012-09-02 * pseudo-reloc.cc (auto_protect_for): New function.Corinna Vinschen1-18/+50
(__write_memory): Call auto_protect_for to handle page protection. (do_pseudo_reloc): Call auto_protect_for to restore old page protection.
2012-08-16whitespace cleanupChristopher Faylor1-1/+1
2012-07-12 * pseudo-reloc.cc: Drop including wchar.h.Corinna Vinschen1-3/+1
(__report_error): Define module as WCHAR. * advapi.cc: Drop including wchar.h. * kernel32.cc: Ditto.
2012-07-02* Makefile.in: Add some more optimization flags for cygwait, malloc and ↵Christopher Faylor1-2/+2
path. Explain why -fomit-frame-pointer doesn't work right for passwd.o and path.o. Add -static to link command line for cygwin0.dll. * fhandler_disk_file.cc (fhandler_disk_file::facl): Reorganize slightly to silence compiler warning when compiling with -fstack-check. * net.cc (inet_ntop6): Initialize structure members to silence compiler warning when compiling with -fstack-check. * pseudo-reloc.cc (_pei386_runtime_relocator): Make this a C function. Detect NULL u. * winsup.h (_pei386_runtime_relocator): Declare this as extern "C". * lib/_cygwin_crt0_common.cc (_pei386_runtime_relocator): Call with NULL argument. * signal.cc (sigaction_worker): Eliminate last argument. Let callers report their own strace info. Regparmize. (sigaction): Reflect sigaction_worker changes. (siginterrupt): Ditto. * exceptions.cc: Update copyright.
2011-06-06whitespace eliminationChristopher Faylor1-3/+3
2011-05-02Eliminate trailing whitespace in some files.Christopher Faylor1-2/+2
* dll_init.cc (dll_list::alloc): Reset 'p' in forked process. * select.cc (select_stuff::wait): Move cleanup() closer to WFMO to minimize unavoidable (?) race.
2010-05-07* Makefile.in (DLL_OFILES): Add pseudo-reloc.o.Christopher Faylor1-89/+71
* dcrt0.cc (child_info_fork::handle_fork): Call _pei386_runtime_relocator here. (dll_crt0_1): Ditto for non-fork case. * dll_init.cc (dll::init): Complain more in comment. Clean up slightly. (dll_dllcrt0_1): Call _pei386_runtime_relocator when we know we have a filled-in per_process structure. * globals.cc (__cygwin_user_data): Accommodate new fields for _pei386_runtime_relocator. * pseudo-reloc.cc: New file adapted from old lib/pseudo-reloc.c. Include winsup.h directly. Collapse #ifdef __CYGWIN__ into one block. Perform minor whitespace code reformatting. (__report_error): Use small_printf to output error. (_pei386_runtime_relocator): Conditionalize for cygwin to take per_process pointer parameter. * winsup.h (_pei386_runtime_relocator): Declare. * include/cygwin/version.h (CYGWIN_VERSION_PER_PROCESS_API_VERSION_COMBINED): New macro. (CYGWIN_VERSION_USER_API_VERSION_COMBINED): Use above macro. (CYGWIN_VERSION_USE_PSEUDO_RELOC_IN_DLL): New macro. (CYGWIN_VERSION_API_MINOR): Bump to 227. * include/sys/cygwin.h: Remove obsolete comment. (per_process::unused2): Shorten. (per_process::pseudo_reloc_start): New field. (per_process::pseudo_reloc_end): Ditto. (per_process::image_base): Ditto. * lib/_cygwin_crt0_common.cc: Declare pseudo runtime externs needed for per_process structure. (_cygwin_crt0_common): Fill in pseudo_reloc runtime constants. * lib/pseudo-reloc-dummy.c: New file. Dummy function to satisify ld. * lib/pseudo-reloc.c: Delete.
2009-10-26Correct pseudo-reloc size bug wrt error messagesCharles Wilson1-2/+3
2009-10-25Sync pseudo-reloc.c with mingw64Charles Wilson1-82/+76
2009-10-07Support pseudo-reloc version 2Charles Wilson1-14/+340
2002-12-09* lib/pseudo-reloc.c: New file.Christopher Faylor1-0/+46
* lib/_cygwin_crt0_common.cc: Perform pseudo-relocs during initialization of cygwin binary (.exe or .dll).