/* This is a complete rewrite, some code snarfed from unexnt.c and
unexec.c, Andy Piper (andy@xemacs.org) 13-1-98 */
/* This is a complete rewrite, some code snarfed from unexnt.c and
unexec.c, Andy Piper (andy@xemacs.org) 13-1-98 */
unexec (char *, char *, void *, void *, void *)
{
PERROR("cannot unexec() a.out.h not installed");
unexec (char *, char *, void *, void *, void *)
{
PERROR("cannot unexec() a.out.h not installed");
#define ALLOC_UNIT 0xFFFF
#define ALLOC_MASK ~((unsigned long)(ALLOC_UNIT))
#define ALIGN_ALLOC(addr) \
((((unsigned long)addr) + ALLOC_UNIT) & ALLOC_MASK)
/* Note that all sections must be aligned on a 0x1000 boundary so
this is the minimum size that our dummy bss can be. */
#define ALLOC_UNIT 0xFFFF
#define ALLOC_MASK ~((unsigned long)(ALLOC_UNIT))
#define ALIGN_ALLOC(addr) \
((((unsigned long)addr) + ALLOC_UNIT) & ALLOC_MASK)
/* Note that all sections must be aligned on a 0x1000 boundary so
this is the minimum size that our dummy bss can be. */
-void unexec (char *out_name, char *in_name, void *start_data,
- void * d1, void * d2)
+int
+unexec (char *out_name, char *in_name, uintptr_t start_data,
+ uintptr_t d1, uintptr_t d2)
}
/* Flip through the executable and cache the info necessary for dumping. */
static void get_section_info (int a_out, char* a_name)
{
}
/* Flip through the executable and cache the info necessary for dumping. */
static void get_section_info (int a_out, char* a_name)
{
file_sz_change=(new_bss_size + data_padding) - BSS_PAD_SIZE;
new_data_size=f_ohdr.dsize + file_sz_change;
file_sz_change=(new_bss_size + data_padding) - BSS_PAD_SIZE;
new_data_size=f_ohdr.dsize + file_sz_change;
lseek (a_new, 0, SEEK_SET);
/* write file header */
f_hdr.f_symptr += file_sz_change;
lseek (a_new, 0, SEEK_SET);
/* write file header */
f_hdr.f_symptr += file_sz_change;
if (write(a_new, &f_ohdr, sizeof(f_ohdr)) != sizeof(f_ohdr))
{
PERROR("failed to write optional header");
if (write(a_new, &f_ohdr, sizeof(f_ohdr)) != sizeof(f_ohdr))
{
PERROR("failed to write optional header");
/* dump bss to maintain offsets */
memset(&f_bss, 0, sizeof(f_bss));
if (write(a_new, &f_bss, sizeof(f_bss)) != sizeof(f_bss))
/* dump bss to maintain offsets */
memset(&f_bss, 0, sizeof(f_bss));
if (write(a_new, &f_bss, sizeof(f_bss)) != sizeof(f_bss))