public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: binutils@sourceware.org
Cc: Ian Lance Taylor <iant@google.com>, cryptooctoploid@gmail.com
Subject: [PATCH gold/6584]] Bad gzip magic number on boot of x86_64 kernel
Date: Fri, 06 Jun 2008 05:32:00 -0000	[thread overview]
Message-ID: <20080605155514.GS13586@oracle.com> (raw)
Message-ID: <20080606053200.nuXj2_HKkZkgdlpiEEVrnUIkDEdGoUw2nWgUtoq82Ck@z> (raw)
In-Reply-To: <20080529205212.GQ13586@oracle.com>

Oracle has a full copyright assignment in place with the FSF.

This patch provides a fix for ticket #6584 'kernel image decompression fails on
64bit machines (linked with gold)'.  Analysis of the problem showed that the
gzip'd image was found to be 8 bytes into the .data section, whereas a kernel
linked with the old ld placed the image 4 bytes into the .data section.
Further code analysis indicated that this discrepancy is due to gold applying
a 64-bit alignment to the image as it is encapsulated as an ELF object.  The
old linker uses an 8-bit alignment for the .data section of ELF encapsulated
binary data.

The patch below corrects this problem.  It was generated against cvs HEAD.
With this patch the kernel decompression completes successfully, and the kernel
execution commences.  My testing didn't result in a fully working system due
to other circumstances, but the testing did prove that the patch does resolve
the issue reported in this PR.

Testsuite execution has been verified to be identical between the unpatched and
the patched version.  No regressions were found.


	Cheers,
	Kris

ChangeLog entry:
================
2008-06-05  Kris Van Hees  <kris.van.hees@oracle.com>

	PR 6584
        * binary.cc (Binary_to_elf::sized_convert): Fix .data
	alignment.

Patch:
======
Index: gold/binary.cc
===================================================================
RCS file: /cvs/src/src/gold/binary.cc,v
retrieving revision 1.2
diff -u -r1.2 binary.cc
--- gold/binary.cc	2 Apr 2008 20:58:21 -0000	1.2
+++ gold/binary.cc	5 Jun 2008 15:18:41 -0000
@@ -207,7 +207,7 @@
 						| elfcpp::SHF_WRITE),
 					       data_offset,
 					       filesize, 0, 0,
-					       align, 0, &pout);
+					       1, 0, &pout);
   this->write_section_header<size, big_endian>(".symtab", &shstrtab,
 					       elfcpp::SHT_SYMTAB,
 					       0, symtab_offset, 4 * sym_size,

  parent reply	other threads:[~2008-06-05 15:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-29 20:52 [PATCH #6407] Patch to resolve issue of non-booting Linux kernel Kris Van Hees
2008-05-29 21:26 ` Kris Van Hees
2008-05-29 23:27 ` Ian Lance Taylor
2008-05-29 23:52   ` Kris Van Hees
2008-05-30 13:42     ` Ian Lance Taylor
2008-06-05 17:30 ` Kris Van Hees [this message]
2008-06-06  5:32   ` [PATCH gold/6584]] Bad gzip magic number on boot of x86_64 kernel Kris Van Hees
2008-06-06  7:14   ` Ian Lance Taylor
2008-08-26 14:09 ` [PATCH gold/6858] Patch to correctly handle undefined symbols in shlibs when linking -shared Kris Van Hees
2008-08-26 14:18   ` [PATCH gold/6859] Symbols specified as -u <symbol> may erroneously get added to dynsym Kris Van Hees
2008-08-27 16:22     ` Ian Lance Taylor
     [not found]       ` <20080826191944.GC16080@oracle.com>
2008-08-28  8:02         ` Kris Van Hees
2008-08-27 16:10   ` [PATCH gold/6858] Patch to correctly handle undefined symbols in shlibs when linking -shared Ian Lance Taylor

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=20080605155514.GS13586@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=binutils@sourceware.org \
    --cc=cryptooctoploid@gmail.com \
    --cc=iant@google.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).