From b34d73171792a089e2fc3728990deae186578c83 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 9 Dec 2011 21:33:20 +0900 Subject: [PATCH] Fix for GNUstep build failure during dumping. * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case that where the value of an _OBJC_* symbol points to is in the .bss section (Bug#10240). --- src/ChangeLog | 6 ++++++ src/unexelf.c | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c533b93916d..44f80ae4098 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-12-09 YAMAMOTO Mitsuharu + + * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case + that where the value of an _OBJC_* symbol points to is in the .bss + section (Bug#10240). + 2011-12-08 Kazuhiro Ito (tiny change) * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end) diff --git a/src/unexelf.c b/src/unexelf.c index 04c029f7e80..1715c3670ca 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -1219,9 +1219,15 @@ temacs: 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 } -- 2.39.2