From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12919 invoked by alias); 22 Apr 2010 21:21:34 -0000 Received: (qmail 12909 invoked by uid 22791); 22 Apr 2010 21:21:33 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SARE_MSGID_LONG45 X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Apr 2010 21:21:25 +0000 Received: by vws4 with SMTP id 4so2242501vws.0 for ; Thu, 22 Apr 2010 14:21:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.44.198 with HTTP; Thu, 22 Apr 2010 14:21:23 -0700 (PDT) In-Reply-To: References: <4BBF7F0B.10508@gmail.com> <4BC07486.5070508@gmail.com> <4BC213FF.6090200@bitwagon.com> Date: Thu, 22 Apr 2010 21:21:00 -0000 Received: by 10.220.108.76 with SMTP id e12mr3075177vcp.144.1271971283576; Thu, 22 Apr 2010 14:21:23 -0700 (PDT) Message-ID: Subject: Re: Help needed to track down bug: linking Linux kernel with gold creates unbootable kernel From: "H.J. Lu" To: Ian Lance Taylor , Suresh Siddha Cc: John Reiser , binutils@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00338.txt.bz2 On Thu, Apr 22, 2010 at 2:10 PM, H.J. Lu wrote: > On Mon, Apr 12, 2010 at 10:27 PM, Ian Lance Taylor wrot= e: >> John Reiser writes: >> >>> The differing .p_align values of 0x1000 vs 0x200000 indicate that >>> gold has a bug interpreting the commands from the linker script >>> for alignment of Elf64_Phdr. >> >> It is perhaps worth noting that for x86_64 gold by default uses -z >> max-page-size 0x1000 whereas the default for GNU ld is -z >> max-page-size 0x200000. =A0While I haven't looked at the Linux linker >> script, perhaps it is assuming the latter. >> > > Linux kernel linker scripts needs to align .rodata section to 2MB: > > . =3D ALIGN((1 << 21)); > > Since gold can only align to 4K, gold can't be used on Linux > kernel. > Hi Ian, If gold should be compatible with ld, this patch should be applied. --=20 H.J. --- diff --git a/gold/x86_64.cc b/gold/x86_64.cc index 9110278..99be4de 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -516,7 +516,7 @@ const Target::Target_info Target_x86_64::x86_64_info =3D '\0', // wrap_char "/lib/ld64.so.1", // program interpreter 0x400000, // default_text_segment_address - 0x1000, // abi_pagesize (overridable by -z max-page-size) + 0x200000, // abi_pagesize (overridable by -z max-page-size) 0x1000, // common_pagesize (overridable by -z common-page-size) elfcpp::SHN_UNDEF, // small_common_shndx elfcpp::SHN_X86_64_LCOMMON, // large_common_shndx