aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/unexelf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/unexelf.c b/src/unexelf.c
index 79a398228ea..0a8b6068d30 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -420,7 +420,7 @@ Filesz Memsz Flags Align
420#include <errno.h> 420#include <errno.h>
421#include <unistd.h> 421#include <unistd.h>
422#include <fcntl.h> 422#include <fcntl.h>
423#ifndef __NetBSD__ 423#if !defined (__NetBSD__) && !defined (__OpenBSD__)
424#include <elf.h> 424#include <elf.h>
425#endif 425#endif
426#include <sys/mman.h> 426#include <sys/mman.h>
@@ -429,7 +429,7 @@ Filesz Memsz Flags Align
429#include <sym.h> 429#include <sym.h>
430#endif /* __sony_news && _SYSTYPE_SYSV */ 430#endif /* __sony_news && _SYSTYPE_SYSV */
431 431
432#if defined (__alpha__) && !defined (__NetBSD__) 432#if defined (__alpha__) && !defined (__NetBSD__) && !defined (__OpenBSD__)
433#include <sym.h> /* get COFF debugging symbol table declaration */ 433#include <sym.h> /* get COFF debugging symbol table declaration */
434#endif 434#endif
435 435
@@ -473,6 +473,10 @@ Filesz Memsz Flags Align
473# endif 473# endif
474#endif /* __NetBSD__ */ 474#endif /* __NetBSD__ */
475 475
476#ifdef __OpenBSD__
477# include <sys/exec_elf.h>
478#endif
479
476#if __GNU_LIBRARY__ - 0 >= 6 480#if __GNU_LIBRARY__ - 0 >= 6
477# include <link.h> /* get ElfW etc */ 481# include <link.h> /* get ElfW etc */
478#endif 482#endif
@@ -682,7 +686,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
682 old_bss_addr = OLD_SECTION_H (old_bss_index).sh_addr; 686 old_bss_addr = OLD_SECTION_H (old_bss_index).sh_addr;
683 old_bss_size = OLD_SECTION_H (old_bss_index).sh_size; 687 old_bss_size = OLD_SECTION_H (old_bss_index).sh_size;
684#endif /* not (__sony_news && _SYSTYPE_SYSV) */ 688#endif /* not (__sony_news && _SYSTYPE_SYSV) */
685#if defined(emacs) || !defined(DEBUG) 689#if defined (emacs) || !defined (DEBUG)
686 new_bss_addr = (ElfW(Addr)) sbrk (0); 690 new_bss_addr = (ElfW(Addr)) sbrk (0);
687#else 691#else
688 new_bss_addr = old_bss_addr + old_bss_size + 0x1234; 692 new_bss_addr = old_bss_addr + old_bss_size + 0x1234;