Don't hardcode CONTEXT size for a NOTE_INFO_THREAD win32pstatus note

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.
This commit is contained in:
Jon Turney 2020-06-29 17:15:02 +01:00
parent 8fbac78b14
commit 03c29a6faf
No known key found for this signature in database
GPG key ID: C7C86F0370285C81
2 changed files with 7 additions and 1 deletions

View 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.

View file

@ -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;