]> sourceware.org Git - newlib-cygwin.git/commit - winsup/utils/ldd.cc
ldd: Handle executable relocation when setting breakpoint
authorCorinna Vinschen <corinna@vinschen.de>
Sat, 2 Jul 2016 10:36:05 +0000 (12:36 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Sat, 2 Jul 2016 10:36:05 +0000 (12:36 +0200)
commit85db21730beb3bb40723fa9b9f2dea5016fc4b4c
tree25b0062d4afb921d067e3459ad5cb40747df84dd
parent9f54ceadae4336b83a724bd3370c0c2dcd00b935
ldd: Handle executable relocation when setting breakpoint

set_entry_point_break() uses GetModuleInformation to fetch the
address of the exe's entry point.  However, just as with
lpStartAddress from the CREATE_PROCESS_DEBUG_EVENT event, the
returned address is only computed from the PE file header.  It's
not actually the entry point in memory, if the executable is
relocated (ASLR).  See
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684229(v=vs.85).aspx

Convert this to using the info from CREATE_PROCESS_DEBUG_EVENT
combined with the offset from the PE file header's  AddressOfEntryPoint
to deal with relocation.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/utils/ldd.cc
This page took 0.029137 seconds and 5 git commands to generate.