Don't hardcode CONTEXT size for a NOTE_INFO_THREAD win32pstatus note
authorJon Turney <jon.turney@dronecode.org.uk>
Mon, 29 Jun 2020 16:15:02 +0000 (17:15 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Wed, 12 Aug 2020 14:08:25 +0000 (15:08 +0100)
Don't hardcode the size of the Win32 API thread CONTEXT type read from a
NOTE_INFO_THREAD win32pstatus note (since it's different on different
architectures).

bfd/ChangeLog:

2020-07-01  Jon Turney  <jon.turney@dronecode.org.uk>

* elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
win32pstatus note.

bfd/ChangeLog
bfd/elf.c

index 84b290527d54389e7c56ab6a32c7aab43fc2fab6..c99e654cc20876af6bdb1354905fffc5b8cfff80 100644 (file)
@@ -1,3 +1,9 @@
+2020-07-01  Jon Turney  <jon.turney@dronecode.org.uk>
+
+       * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
+       the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
+       win32pstatus note.
+
 2020-07-11  Jon Turney  <jon.turney@dronecode.org.uk>
 
        * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
index 26a4d32d1856bfea23aa9a87123d8b26532bfc79..43a6cba89dacfa617950feb527a6819f80d4c0f0 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -10178,7 +10178,7 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note)
        return FALSE;
 
       /* sizeof (thread_info.thread_context) */
-      sect->size = 716;
+      sect->size = note->descsz - 12;
       /* offsetof (thread_info.thread_context) */
       sect->filepos = note->descpos + 12;
       sect->alignment_power = 2;