-/* Copyright (C) 1985-1988, 1990, 1992, 1999-2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1985-1988, 1990, 1992, 1999-2013 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
/*
* NetBSD does not have normal-looking user-land ELF support.
*/
-# if defined __alpha__ || defined __sparc_v9__
+# if defined __alpha__ || defined __sparc_v9__ || defined _LP64
# define ELFSIZE 64
# else
# define ELFSIZE 32
#endif
#ifndef ElfW
-# ifdef __STDC__
-# define ElfBitsW(bits, type) Elf##bits##_##type
-# else
-# define ElfBitsW(bits, type) Elf/**/bits/**/_/**/type
-# endif
-# ifdef _LP64
-# define ELFSIZE 64
-# else
-# define ELFSIZE 32
+# define ElfBitsW(bits, type) Elf##bits##_##type
+# ifndef ELFSIZE
+# ifdef _LP64
+# define ELFSIZE 64
+# else
+# define ELFSIZE 32
+# endif
# endif
/* This macro expands `bits' before invoking ElfBitsW. */
# define ElfExpandBitsW(bits, type) ElfBitsW (bits, type)
nn = symp->st_shndx;
if (nn > old_bss_index)
nn--;
- old = ((symp->st_value - NEW_SECTION_H (symp->st_shndx).sh_addr)
- + OLD_SECTION_H (nn).sh_offset + old_base);
- memcpy (new, old, symp->st_size);
+ if (nn == old_bss_index)
+ memset (new, 0, symp->st_size);
+ else
+ {
+ old = ((symp->st_value
+ - NEW_SECTION_H (symp->st_shndx).sh_addr)
+ + OLD_SECTION_H (nn).sh_offset + old_base);
+ memcpy (new, old, symp->st_size);
+ }
}
#endif
}