GNU bug report logs - #20614
Segmentation fault when building on Power8 Little Endian

Previous Next

Package: emacs;

Reported by: Petr Hracek <phracek <at> redhat.com>

Date: Wed, 20 May 2015 07:59:01 UTC

Severity: important

Tags: patch

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Petr Hracek <phracek <at> redhat.com>
To: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 20614 <at> debbugs.gnu.org, jcapik <at> redhat.com
Subject: bug#20614: Segmentation fault when building on Power8 Little Endian
Date: Wed, 7 Oct 2015 14:26:46 +0200
On 10/07/2015 12:56 PM, YAMAMOTO Mitsuharu wrote:
> What happens if you apply the following patch?
>
> 				     YAMAMOTO Mitsuharu
> 				mituharu <at> math.s.chiba-u.ac.jp
>
> diff --git a/src/unexelf.c b/src/unexelf.c
> index 59e2725..0d67b99 100644
> --- a/src/unexelf.c
> +++ b/src/unexelf.c
> @@ -730,7 +730,14 @@ unexec (const char *new_name, const char *old_name)
>     old_plt_index = find_section (".plt", old_section_names,
>   				old_name, old_file_h, old_section_h, 1);
>     if (old_plt_index != -1)
> -    if (OLD_SECTION_H (old_plt_index).sh_type != SHT_NOBITS)
> +    if (OLD_SECTION_H (old_plt_index).sh_type != SHT_NOBITS
> +	|| ((OLD_SECTION_H (old_plt_index).sh_addr
> +	     + OLD_SECTION_H (old_plt_index).sh_size
> +	     != OLD_SECTION_H (old_bss_index).sh_addr)
> +	    && (old_sbss_index == -1
> +		|| (OLD_SECTION_H (old_plt_index).sh_addr
> +		    + OLD_SECTION_H (old_plt_index).sh_size
> +		    != OLD_SECTION_H (old_sbss_index).sh_addr))))
>         old_plt_index = -1;
>   
>     if (old_sbss_index == -1 && old_plt_index == -1)
Awesome. The patch fixes the problem and I can build the emacs under 
PPC64LE.

By the way .toc is still not fixed. It is specific to ppc64. And it 
doesn't cause the segfault, though.
It has a data and addresses.
It seems that unexec corrupted it:(

-- 
Petr Hracek
Software Engineer
Developer Experience
Red Hat, Inc
Mob: +420777056169
email: phracek <at> redhat.com





This bug report was last modified 9 years and 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.