all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Petr Hracek <phracek@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: fw@deneb.enyo.de, 20614@debbugs.gnu.org, Nick Clifton <nickc@redhat.com>
Subject: bug#20614: Segmentation fault when building on Power8 Little Endian
Date: Thu, 1 Oct 2015 13:44:01 +0200	[thread overview]
Message-ID: <560D1C81.2080109@redhat.com> (raw)
In-Reply-To: <83r3lf9gq4.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 5088 bytes --]

On 10/01/2015 09:43 AM, Eli Zaretskii wrote:
>> From: Petr Hracek <phracek@redhat.com>
>> Date: Wed, 30 Sep 2015 12:39:47 +0200
>> Cc: 20614@debbugs.gnu.org
>>
>> My deep observation with emacs package and binutils:
>> 1) binutils-2.23.52.0.1-30.el7_1.2.ppc64le.rpm works completely.
>> 2) binutils-2.23.52.0.1-40.el7.ppc64le.rpm works if row
>> http://git.savannah.gnu.org/cgit/emacs.git/tree/src/unexelf.c?h=emacs-24#n869
>> is suppressed.
>>
>> With newer version of binutils I can see the same series:(
>> like:
>> Dumping under the name emacs
>> emacs: Program segment above .bss in
>> /builddir/build/BUILD/emacs-24.3/src/temacs
>> make[2]: Leaving directory `/builddir/build/BUILD/emacs-24.3/src'
>> make[2]: *** [bootstrap-emacs] Error 1
>>
>> I have collected list of commits and messages against upstream:
>> #1200138
>> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=43a8475ca01b676fb764aaed0c4ed1cc16fc3c87 #1200138
>> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=eec2f3ed9f053653ed5d629eb50e08e3ee61e9bd #1203449
>> https://bugzilla.redhat.com/attachment.cgi?id=1003499 # 1175624 .opd
>> https://sourceware.org/ml/binutils/2015-01/msg00227.html
>> # 1175624 .got which implies .sdata, .sbss, .plt .iplt and .branch_lt also have
>> to move: https://sourceware.org/ml/binutils/2015-01/msg00228.html
>> # 1175624 And .toc1: https://sourceware.org/ml/binutils/2015-01/msg00232.html
>> #1194164 func@localentry expressions, which was added to FSF binutils with git
>> commit 45965137
>> #1183838 https://bugzilla.redhat.com/attachment.cgi?id=986213
>> # 1172766 https://bugzilla.redhat.com/attachment.cgi?id=989450 I hope it helps
>> you a bit.
> I think we need help from someone who understands the Binutils part of
> this.  Can you ask some of the Binutils maintainers please join this
> discussion and analyze the problem?
Out binutils maintainers send me reference to following patch.
|# Fix incorrectly generated ELF binaries and DSOs|

diff -Nrup a/bfd/elf.c b/bfd/elf.c
--- a/bfd/elf.c	2015-07-28 10:52:10.941754850 -0600
+++ b/bfd/elf.c	2015-07-28 10:53:34.725982912 -0600
@@ -4081,11 +4081,18 @@ _bfd_elf_map_sections_to_segments (bfd *
  	      new_segment = TRUE;
  	    }
  	  else if ((last_hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0
-		   && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0)
+		   && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0
+		   && ((abfd->flags & D_PAGED) == 0
+		       || (((last_hdr->lma + last_size - 1) & -maxpagesize)
+			   != (hdr->lma & -maxpagesize))))
  	    {
-	      /* We don't want to put a loadable section after a
-		 nonloadable section in the same segment.
-		 Consider .tbss sections as loadable for this purpose.  */
+	      /* We don't want to put a loaded section after a
+		 nonloaded (ie. bss style) section in the same segment
+		 as that will force the non-loaded section to be loaded.
+		 Consider .tbss sections as loaded for this purpose.
+		 However, like the writable/non-writable case below,
+		 if they are on the same page then they must be put
+		 in the same segment.  */
  	      new_segment = TRUE;
  	    }
  	  else if ((abfd->flags & D_PAGED) == 0)
diff -Nrup a/ld/testsuite/ld-powerpc/elfv2so.d b/ld/testsuite/ld-powerpc/elfv2so.d
--- a/ld/testsuite/ld-powerpc/elfv2so.d	2015-07-28 10:52:10.921755273 -0600
+++ b/ld/testsuite/ld-powerpc/elfv2so.d	2015-07-28 10:41:10.046732001 -0600
@@ -7,31 +7,31 @@
  
  Disassembly of section \.text:
  
-0+320 <.*\.plt_call\.f4>:
+0+300 <.*\.plt_call\.f4>:
  .*:	(18 00 41 f8|f8 41 00 18) 	std     r2,24\(r1\)
  .*:	(38 80 82 e9|e9 82 80 38) 	ld      r12,-32712\(r2\)
  .*:	(a6 03 89 7d|7d 89 03 a6) 	mtctr   r12
  .*:	(20 04 80 4e|4e 80 04 20) 	bctr
  
-0+330 <.*\.plt_call\.f3>:
+0+310 <.*\.plt_call\.f3>:
  .*:	(18 00 41 f8|f8 41 00 18) 	std     r2,24\(r1\)
  .*:	(28 80 82 e9|e9 82 80 28) 	ld      r12,-32728\(r2\)
  .*:	(a6 03 89 7d|7d 89 03 a6) 	mtctr   r12
  .*:	(20 04 80 4e|4e 80 04 20) 	bctr
  
-0+340 <.*\.plt_call\.f2>:
+0+320 <.*\.plt_call\.f2>:
  .*:	(18 00 41 f8|f8 41 00 18) 	std     r2,24\(r1\)
  .*:	(30 80 82 e9|e9 82 80 30) 	ld      r12,-32720\(r2\)
  .*:	(a6 03 89 7d|7d 89 03 a6) 	mtctr   r12
  .*:	(20 04 80 4e|4e 80 04 20) 	bctr
  
-0+350 <.*\.plt_call\.f1>:
+0+330 <.*\.plt_call\.f1>:
  .*:	(18 00 41 f8|f8 41 00 18) 	std     r2,24\(r1\)
  .*:	(40 80 82 e9|e9 82 80 40) 	ld      r12,-32704\(r2\)
  .*:	(a6 03 89 7d|7d 89 03 a6) 	mtctr   r12
  .*:	(20 04 80 4e|4e 80 04 20) 	bctr
  
-0+360 <f1>:
+0+340 <f1>:
  .*:	(02 00 4c 3c|3c 4c 00 02) 	addis   r2,r12,2
  .*:	(d8 81 42 38|38 42 81 d8) 	addi    r2,r2,-32296
  .*:	(a6 02 08 7c|7c 08 02 a6) 	mflr    r0
@@ -53,7 +53,7 @@ Disassembly of section \.text:
  .*:	(98 01 01 00|00 00 00 00) 	.*
  .*:	(00 00 00 00|00 01 01 98) 	.*
  
-0+3b0 <__glink_PLTresolve>:
+0+390 <__glink_PLTresolve>:
  .*:	(a6 02 08 7c|7c 08 02 a6) 	mflr    r0
  .*:	(05 00 9f 42|42 9f 00 05) 	bcl     .*
  .*:	(a6 02 68 7d|7d 68 02 a6) 	mflr    r11




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


[-- Attachment #2: Type: text/html, Size: 7224 bytes --]

  parent reply	other threads:[~2015-10-01 11:44 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20  7:56 bug#20614: Segmentation fault when building on Power8 Little Endian Petr Hracek
2015-05-20 14:45 ` Eli Zaretskii
2015-05-20 16:12 ` Glenn Morris
2015-05-21 12:55   ` Petr Hracek
2015-07-13 11:27     ` Petr Hracek
2015-07-13 13:16       ` Andreas Schwab
2015-07-14  7:52         ` Petr Hracek
2015-07-14  8:14           ` Andreas Schwab
2015-09-16 11:28           ` Petr Hracek
2015-09-22 10:17             ` Petr Hracek
2015-09-23  8:06               ` Petr Hracek
2015-09-23  9:34                 ` Eli Zaretskii
2015-09-23 11:00                   ` Petr Hracek
2015-09-23 11:14                     ` Eli Zaretskii
2015-09-23 12:11                       ` Petr Hracek
2015-09-23 12:23                         ` Eli Zaretskii
2015-09-24 11:04                           ` Petr Hracek
2015-09-24 15:32                             ` Eli Zaretskii
2015-09-24 17:56                               ` Petr Hracek
2015-09-26  7:58                                 ` Eli Zaretskii
2015-09-30 10:39                                   ` Petr Hracek
2015-10-01  7:43                                     ` Eli Zaretskii
2015-10-01  8:46                                       ` Petr Hracek
2015-10-01 11:44                                       ` Petr Hracek [this message]
2015-10-01 11:53                                       ` Petr Hracek
2015-10-01 12:22                                         ` Eli Zaretskii
2015-10-01 14:05                                           ` Petr Hracek
2015-10-01 16:01                                             ` Eli Zaretskii
2015-10-02  8:36                                               ` Petr Hracek
2015-10-02  8:49                                                 ` Eli Zaretskii
2015-10-02 12:58                                                   ` Petr Hracek
2015-10-02 13:46                                                     ` Eli Zaretskii
2015-10-05  7:40                                                       ` Petr Hracek
2015-10-05  8:27                                                         ` Eli Zaretskii
2015-10-05  9:16                                                           ` Petr Hracek
2015-10-05  9:39                                                             ` Eli Zaretskii
2015-10-05 11:23                                                               ` Petr Hracek
2015-10-05 11:40                                                                 ` Eli Zaretskii
2015-10-05 14:07                                                                   ` Petr Hracek
2015-10-05 16:52                                                                     ` Eli Zaretskii
2015-10-06  8:41                                                                       ` Petr Hracek
2015-10-06 11:52                                                                         ` Petr Hracek
2015-10-06 14:55                                                                           ` Eli Zaretskii
2015-10-07  8:17                                                                             ` Petr Hracek
2015-10-07 10:56                                                                               ` YAMAMOTO Mitsuharu
2015-10-07 12:26                                                                                 ` Petr Hracek
2015-10-08  0:54                                                                                   ` YAMAMOTO Mitsuharu
2015-10-08 13:27                                                                                     ` Jaromir Capik
2015-10-10  1:40                                                                                       ` YAMAMOTO Mitsuharu
2015-10-10 15:44                                                                                         ` Andreas Schwab
2015-10-13  7:30                                                                                           ` Petr Hracek
2015-10-13  8:30                                                                                             ` Andreas Schwab
2015-10-16 15:24                                                                                               ` Jaromir Capik
2015-10-19  7:20                                                                                                 ` Andreas Schwab
2015-09-23 12:10                   ` Petr Hracek
2015-09-23 12:21                     ` Eli Zaretskii
2015-09-23 13:10                       ` Petr Hracek
2015-09-23 13:38                       ` Petr Hracek
2015-09-23 13:57                         ` Eli Zaretskii
2015-09-23 17:25                           ` Glenn Morris
2015-09-23 17:47               ` Glenn Morris
2015-09-29  8:15                 ` Florian Weimer
2015-07-13 12:17   ` bug#20614: Segmentation fault when building on Power8 Little Endian (ppc64le) Petr Hracek
2015-11-17  1:59 ` bug#20614: alignment problem with recent Emacs unexelf.c changes Paul Eggert
2015-11-17  9:03   ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560D1C81.2080109@redhat.com \
    --to=phracek@redhat.com \
    --cc=20614@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=fw@deneb.enyo.de \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.