public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Brendan Simon <brendan@dgs.monash.edu.au>
To: binutils <binutils@sourceware.cygnus.com>,
	Dan Malek <dmalek@jlc.net>,
	Magnus Damm <eramdam@kieray1.p.y.ki.era.ericsson.se>,
	gdb <gdb@sourceware.cygnus.com>
Subject: objdump or gdb to force a section to load ?
Date: Thu, 01 Jul 1999 00:00:00 -0000	[thread overview]
Message-ID: <37685993.EB50E446@dgs.monash.edu.au> (raw)
In-Reply-To: <3766EA73.123505A6@dgs.monash.edu.au>

I sent this a while ago and got no response.  I'm resending it just in case
it got lost.
Sorry if you have already received this before.
Brendan Simon.

Brendan Simon wrote:

> I have a linux kernel compiled for a mpc860 target and am trying to get
> it to run by downloading it into memory using a background debugger
> (BDM).  The boot code gets to the point where it trys to uncompress the
> kernel but fails because the image isn't loaded into memory (only .text,
> .rodata and .data are loaded).  I tried using objcopy to set the "image"
> section to "load" but it does not seem to work.  How can I get gdb to
> load the image section (either using a gdb command or binutils) ?
>
> Here is a before/after trace using objcopy --set-section-flags.  As you
> can see, the load attribute is not set.  I've tried all combinations of
> attributes but I can't get it to work.  Am I doing something wrong ?
>
> powerpc-linux-objdump --section-headers myzimage
> myzimage:     file format elf32-powerpc
> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>   0 .text         00004324  00100000  00100000  00010000  2**2
>                   CONTENTS, ALLOC, LOAD, READONLY, CODE
>   1 .rodata       00000460  00104330  00104330  00014330  2**4
>                   CONTENTS, ALLOC, LOAD, READONLY, DATA
>   2 .data         000002f8  00105000  00105000  00015000  2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>   3 .bss          0000bbac  00106000  00106000  00016000  2**2
>                   ALLOC
>   4 image         0006ccbf  00000000  00000000  00016000  2**0
>                   CONTENTS, READONLY
>
> powerpc-linux-objcopy --set-section-flags=image=load myzimage
>
> powerpc-linux-objdump --section-headers myzimage
> myzimage:     file format elf32-powerpc
> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>   0 .text         00004324  00100000  00100000  00010000  2**2
>                   CONTENTS, ALLOC, LOAD, READONLY, CODE
>   1 .rodata       00000460  00104330  00104330  00014330  2**4
>                   CONTENTS, ALLOC, LOAD, READONLY, DATA
>   2 .data         000002f8  00105000  00105000  00015000  2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>   3 .bss          0000bbac  00106000  00106000  00016000  2**2
>                   ALLOC
>   4 image         0006ccbf  00000000  00000000  00016000  2**0
>                   CONTENTS

  parent reply	other threads:[~1999-07-01  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-01  0:00 Using objdump to force a section to load with gdb Brendan Simon
1999-07-01  0:00 ` Ian Lance Taylor
1999-07-01  0:00   ` Brendan Simon
1999-07-01  0:00     ` Ian Lance Taylor
1999-07-01  0:00 ` Brendan Simon [this message]
1999-07-01  0:00   ` objdump or gdb to force a section to load ? Jonathan Larmour
     [not found]     ` <376981EF.BE10D7C8@dgs.monash.edu.au>
     [not found]       ` <37699391.2CF83050@cygnus.co.uk>
1999-07-01  0:00         ` SOLVED: " Brendan Simon
1999-07-01  0:00           ` 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=37685993.EB50E446@dgs.monash.edu.au \
    --to=brendan@dgs.monash.edu.au \
    --cc=binutils@sourceware.cygnus.com \
    --cc=dmalek@jlc.net \
    --cc=eramdam@kieray1.p.y.ki.era.ericsson.se \
    --cc=gdb@sourceware.cygnus.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).