linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Getting the image section of the ELF file to load w/ VxWorks boot ROM
@ 2000-05-02 17:24 diekema_jon
  2000-05-03  8:07 ` Arto Vuori
  2000-05-09 10:04 ` Frank Przybylski
  0 siblings, 2 replies; 6+ messages in thread
From: diekema_jon @ 2000-05-02 17:24 UTC (permalink / raw)
  To: linuxppc-embedded, bkuschak, jim.chapman, frank


	I am having trouble loading the image section of the elf file
	(contains the gzip compressed Linux kernel) with the VxWorks boot
	ROM or the EST VisionICE on the EST SBC8260 board.  Both of these
	options appear to ignore this section.

	This problem was discussed on the linuxppc-embedded mailing list
	on 11/2[2-3]/99.  A few approaches were put forth, but not all the
	details were included.  Does someone have a recipe on how to solve
	this problem?

	CPU: EST Corp. est8260 -- MPC8260 PowerQUICC II SBC
	Version: 5.4
        BSP version: 1.2/3

	I have managed to use ".gzimage" instead of "image" as the
	section name and have changed the section flags, but I don't
	think this is enough.

bucks 2166} powerpc-linux-objdump -h zImage

zImage:     file format elf32-powerpc

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00004494  00400000  00400000  00010000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .rodata       00000470  004044a0  004044a0  000144a0  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .data         0000030c  00405000  00405000  00015000  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  3 .data.init    00000000  00406000  00406000  00016000  2**0
                  CONTENTS
  4 .bss          0000526c  00406000  00406000  00016000  2**2
                  ALLOC
  5 .gzimage      0006fd80  00000000  00000000  00020000  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting the image section of the ELF file to load w/ VxWorks boot ROM
  2000-05-02 17:24 Getting the image section of the ELF file to load w/ VxWorks boot ROM diekema_jon
@ 2000-05-03  8:07 ` Arto Vuori
  2000-05-09 10:04 ` Frank Przybylski
  1 sibling, 0 replies; 6+ messages in thread
From: Arto Vuori @ 2000-05-03  8:07 UTC (permalink / raw)
  To: diekema_jon; +Cc: linuxppc-embedded, bkuschak, jim.chapman, frank


diekema_jon wrote:
>
>         I am having trouble loading the image section of the elf file
>         (contains the gzip compressed Linux kernel) with the VxWorks boot
>         ROM or the EST VisionICE on the EST SBC8260 board.  Both of these
>         options appear to ignore this section.
>

I had similar problems. It seems that EST tools don't convert all ELF
sections in zImage. I managed to get around the problem by building
bootimage by using different method than in arch/ppc/coffboot or
mbxboot. Instead using objcopy to add new sections, i use
arch/ppc/chrpboot/piggypack.c to generate object files from images and
after that link them with rest of objects. Here's couple lines from my
Makefile that does the actual job:

image.o: piggyback ../coffboot/vmlinux.gz
        ./piggyback image < ../coffboot/vmlinux.gz | $(AS) -o image.o

zImage: $(OBJS) no_initrd.o mknote
        $(LD) $(LD_ARGS) -o $@ $(OBJS) no_initrd.o $(LIBS)
        ./mknote > note
        $(OBJCOPY) $@ $@ --add-section=.note=note -R .comment

You also need to modify some .c files so that they can find the image
address and size.

--
Arto Vuori
email: avuori@ssh.com
mobile:	+358 40 754 5223

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting the image section of the ELF file to load w/ VxWorks boot ROM
  2000-05-02 17:24 Getting the image section of the ELF file to load w/ VxWorks boot ROM diekema_jon
  2000-05-03  8:07 ` Arto Vuori
@ 2000-05-09 10:04 ` Frank Przybylski
  2000-05-09 15:54   ` Daniel G. Clemmensen
  2000-05-17 20:30   ` Getting the image section of the ELF file to load w/ VxWorks boot ROM Dan Malek
  1 sibling, 2 replies; 6+ messages in thread
From: Frank Przybylski @ 2000-05-09 10:04 UTC (permalink / raw)
  To: linuxppc-embedded


Hi,
I had similar problems when loading kernel images with gdb over BDM into
an MPC.
I have no solution (which would be a patch to the Makefile in
/usr/src/linux/arch/ppc/mbxboot) but I try to handle the symptons:
  powerpc-linux-objcopy \
    --set-section-flags=image=contents,alloc,load,readonly,data \
    --adjust-section-vma=image=$(powerpc-linux-objdump -h
$kernel/zvmlinux | grep .bss | awk '{print "0x"$4}') \
    $kernel/zvmlinux \
    $kernel/zvmlinux2

The first command to objcopy is to set the 'load' flag for the image
section. Without this, gdb won't load this section.
The second is to patch the load address of that section to be the same
as the .bss section. I'm a little bit unsecure about the last, but it
seems to work. I think this is what the loader expects and I hope
someone can verify this?

hth
	Frank

--
===============================================================================
Frank Przybylski,VAS GmbH,Gotenstr.6,20097
Hamburg,GERMANY,TEL:+49-40-238568-14
   mailto:Frank.Przybylski@vas-gmbh.de , visit us at
http://www.vas-gmbh.de
===============================================================================

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting the image section of the ELF file to load w/ VxWorks boot ROM
  2000-05-09 10:04 ` Frank Przybylski
@ 2000-05-09 15:54   ` Daniel G. Clemmensen
  2000-05-09 17:51     ` Getting the image section of the ELF file to load w/ VxWorks boot diekema_jon
  2000-05-17 20:30   ` Getting the image section of the ELF file to load w/ VxWorks boot ROM Dan Malek
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel G. Clemmensen @ 2000-05-09 15:54 UTC (permalink / raw)
  To: Frank Przybylski; +Cc: linuxppc-embedded


Frank Przybylski wrote:
>
> Hi,
> I had similar problems when loading kernel images with gdb over BDM into
> an MPC.
> I have no solution (which would be a patch to the Makefile in
> /usr/src/linux/arch/ppc/mbxboot) but I try to handle the symptons:
>   powerpc-linux-objcopy \
>     --set-section-flags=image=contents,alloc,load,readonly,data \
>     --adjust-section-vma=image=$(powerpc-linux-objdump -h
> $kernel/zvmlinux | grep .bss | awk '{print "0x"$4}') \
>     $kernel/zvmlinux \
>     $kernel/zvmlinux2
>
> The first command to objcopy is to set the 'load' flag for the image
> section. Without this, gdb won't load this section.
> The second is to patch the load address of that section to be the same
> as the .bss section. I'm a little bit unsecure about the last, but it
> seems to work. I think this is what the loader expects and I hope
> someone can verify this?
>

I was able to load successfully using a variant of the second method:
I used objcopy to remove the .bss section. This appears to also make the
zImage file smaller by 60,000 bytes or so. I checked the boot code and
determined that this method WILL work if the zImage is NOT initially loaded
into the location is linked for, and WILL NOT work if the zImage IS initially
loaded into the location it is linked for. The reason: The code really does
use the location the .bss section is linked to store read/write variables.
If the image section is physically at that location, it will be damaged.
But,the code then moves itself, but not the image, to its origin location,
and then decompresses the image from its load location to its own origin location.
All of this works just fine, since in this case the image is never resident in the
compiled-in .bss location.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting the image section of the ELF file to load w/ VxWorks boot
  2000-05-09 15:54   ` Daniel G. Clemmensen
@ 2000-05-09 17:51     ` diekema_jon
  0 siblings, 0 replies; 6+ messages in thread
From: diekema_jon @ 2000-05-09 17:51 UTC (permalink / raw)
  To: linuxppc-embedded


The approach that I settled upon was identified in my initial post,
however I didn't actually do all the steps.  I have attached the the
files that are needed to make it work.

Note: The Linux_2_3 BitKeeper repository at FMS Labs contains
      these changes.

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2000-05-09 13:39 EDT by <diekema@bucks>.
# Source directory was `/home/bucks/users/diekema'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   3708 -rw-r--r-- arch/ppc/mbxboot/Makefile
#    156 -rw-r--r-- arch/ppc/mbxboot/gzimage.c
#    156 -rw-r--r-- arch/ppc/mbxboot/rdimage.c
#   3415 -rw-r--r-- arch/ppc/mbxboot/vmlinux.lds
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
if mkdir _sh04766; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= arch/ppc/mbxboot/Makefile ==============
if test ! -d 'arch'; then
  $echo 'x -' 'creating directory' 'arch'
  mkdir 'arch'
fi
if test ! -d 'arch/ppc'; then
  $echo 'x -' 'creating directory' 'arch/ppc'
  mkdir 'arch/ppc'
fi
if test ! -d 'arch/ppc/mbxboot'; then
  $echo 'x -' 'creating directory' 'arch/ppc/mbxboot'
  mkdir 'arch/ppc/mbxboot'
fi
if test -f 'arch/ppc/mbxboot/Makefile' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'arch/ppc/mbxboot/Makefile' '(file already exists)'
else
  $echo 'x -' extracting 'arch/ppc/mbxboot/Makefile' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'arch/ppc/mbxboot/Makefile' &&
#
# arch/ppc/mbxboot/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
# Adapted for PowerPC by Gary Thomas
# modified by Cort (cort@cs.nmt.edu)
#
X.c.s:
X	$(CC) $(CFLAGS) -S -o $*.s $<
X.s.o:
X	$(AS) -o $*.o $<
X.c.o:
X	$(CC) $(CFLAGS)  -DINITRD_OFFSET=$(IOFF) -DINITRD_SIZE=$(ISZ) -DZIMAGE_OFFSET=$(ZOFF) -DZIMAGE_SIZE=$(ZSZ) -c -o $*.o $<
X.S.s:
X	$(CPP) $(AFLAGS) -traditional -o $*.o $<
X.S.o:
X	$(CC) $(AFLAGS) -traditional -c -o $*.o $<
X
ZOFF = 0
ZSZ = 0
IOFF = 0
ISZ = 0
X
TFTPIMAGE=/tftpboot/zImage.embedded
X
ifdef CONFIG_8xx
ZLINKFLAGS = -T vmlinux.lds -Ttext 0x00180000
OBJECTS := head.o misc.o ../coffboot/zlib.o m8xx_tty.o gzimage.o rdimage.o
CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS -fno-builtin -DCONFIG_8xx
endif
X
ifdef CONFIG_8260
ZLINKFLAGS = -T vmlinux.lds -Ttext 0x00400000
OBJECTS := head_8260.o misc.o ../coffboot/zlib.o m8260_tty.o embed_config.o gzimage.o rdimage.o
CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS -fno-builtin -DCONFIG_8260
endif
X
OBJCOPY_ARGS = -O elf32-powerpc
X
ifeq ($(CONFIG_MBX),y)
OBJECTS += pci.o qspan_pci.o
CFLAGS += -DCONFIG_MBX
endif
ifeq ($(CONFIG_RPXLITE),y)
CFLAGS += -DCONFIG_RPXLITE
OBJECTS += iic.o embed_config.o
endif
ifeq ($(CONFIG_RPXCLASSIC),y)
CFLAGS += -DCONFIG_RPXCLASSIC
OBJECTS += iic.o embed_config.o pci.o qspan_pci.o
endif
ifeq ($(CONFIG_BSEIP),y)
CFLAGS += -DCONFIG_BSEIP
OBJECTS += iic.o embed_config.o
endif
X
all:	zImage
X
zvmlinux.initrd: zvmlinux
#
# Build the boot loader images
#
X	$(OBJCOPY) $(OBJCOPY_ARGS) -R .gzimage gzimage.o
X	$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
X		--add-section=.gzimage=../coffboot/vmlinux.gz \
X		--set-section-flags=.gzimage=alloc,load,readonly,data \
X		gzimage.o
X	$(OBJCOPY) $(OBJCOPY_ARGS) -R .rdimage rdimage.o
X	$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
X		--add-section=.rdimage=ramdisk.image.gz \
X		--set-section-flags=.rdimage=alloc,load,readonly,data \
X		rdimage.o
X	$(LD) $(ZLINKFLAGS) -o $@ $(OBJECTS)
#
# Compute the sizes/offsets for the final image, and rebuild with these values.
#
X	$(CC) $(CFLAGS) \
X		-DINITRD_OFFSET=`sh offset $(OBJDUMP) zvmlinux.initrd .rdimage` \
X		-DINITRD_SIZE=`sh size $(OBJDUMP) zvmlinux.initrd .rdimage` \
X		-DZIMAGE_OFFSET=`sh offset $(OBJDUMP) zvmlinux.initrd .gzimage` \
X		-DZIMAGE_SIZE=`sh size $(OBJDUMP) zvmlinux.initrd .gzimage` \
X		-c -o misc.o misc.c
X	$(LD) $(ZLINKFLAGS) -o $@ $(OBJECTS)
X	$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment $@
X	$(OBJDUMP) -h $@
X
zImage: zvmlinux
X	ln -sf zvmlinux zImage
X
zImage.initrd: zvmlinux.initrd
X	ln -sf zvmlinux.initrd zImage.initrd
X
zvmlinux: $(OBJECTS) ../coffboot/vmlinux.gz
#
# Build the boot loader images
#
#
X	$(OBJCOPY) $(OBJCOPY_ARGS) -R .gzimage gzimage.o
X	$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
X		--add-section=.gzimage=../coffboot/vmlinux.gz \
X		--set-section-flags=.gzimage=alloc,load,readonly,data \
X		gzimage.o
X	$(LD) $(ZLINKFLAGS) -o $@ $(OBJECTS)
#
# Compute the sizes/offsets for the final image, and rebuild with these values.
#
X	$(CC) $(CFLAGS) \
X		-DINITRD_OFFSET=0 \
X		-DINITRD_SIZE=0 \
X		-DZIMAGE_OFFSET=`sh offset $(OBJDUMP) zvmlinux .gzimage` \
X		-DZIMAGE_SIZE=`sh size $(OBJDUMP) zvmlinux .gzimage` \
X		-c -o misc.o misc.c
X	$(LD) $(ZLINKFLAGS) -o $@ $(OBJECTS)
X	$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment $@
X	$(OBJDUMP) -h $@
X
znetboot : zImage
X	cp zImage $(TFTPIMAGE)
X
znetboot.initrd : zImage.initrd
X	cp zImage.initrd $(TFTPIMAGE)
X
clean:
X	rm -f vmlinux* zvmlinux* zImage*
X
fastdep:
X	$(TOPDIR)/scripts/mkdep *.[Sch] > .depend
X
dep:
X	$(CPP) $(CPPFLAGS) -M *.S *.c > .depend
X
# just here to match coffboot/Makefile
vmlinux.coff:
X
vmlinux.coff.initrd:
SHAR_EOF
  $shar_touch -am 05060231100 'arch/ppc/mbxboot/Makefile' &&
  chmod 0644 'arch/ppc/mbxboot/Makefile' ||
  $echo 'restore of' 'arch/ppc/mbxboot/Makefile' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'arch/ppc/mbxboot/Makefile:' 'MD5 check failed'
4ef1fd04948006dccd8474e4e7479ba0  arch/ppc/mbxboot/Makefile
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'arch/ppc/mbxboot/Makefile'`"
    test 3708 -eq "$shar_count" ||
    $echo 'arch/ppc/mbxboot/Makefile:' 'original size' '3708,' 'current size' "$shar_count!"
  fi
fi
# ============= arch/ppc/mbxboot/gzimage.c ==============
if test -f 'arch/ppc/mbxboot/gzimage.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'arch/ppc/mbxboot/gzimage.c' '(file already exists)'
else
  $echo 'x -' extracting 'arch/ppc/mbxboot/gzimage.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'arch/ppc/mbxboot/gzimage.c' &&
/*
X * gzimage.c
X *
X * Dummy file to allow a compressed zImage to be added
X * into a linker section, accessed by the boot coode
X */
X
char dummy_for_gzimage;
SHAR_EOF
  $shar_touch -am 05040233100 'arch/ppc/mbxboot/gzimage.c' &&
  chmod 0644 'arch/ppc/mbxboot/gzimage.c' ||
  $echo 'restore of' 'arch/ppc/mbxboot/gzimage.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'arch/ppc/mbxboot/gzimage.c:' 'MD5 check failed'
111ba05ecf9b8794b789b9b649d7401f  arch/ppc/mbxboot/gzimage.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'arch/ppc/mbxboot/gzimage.c'`"
    test 156 -eq "$shar_count" ||
    $echo 'arch/ppc/mbxboot/gzimage.c:' 'original size' '156,' 'current size' "$shar_count!"
  fi
fi
# ============= arch/ppc/mbxboot/rdimage.c ==============
if test -f 'arch/ppc/mbxboot/rdimage.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'arch/ppc/mbxboot/rdimage.c' '(file already exists)'
else
  $echo 'x -' extracting 'arch/ppc/mbxboot/rdimage.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'arch/ppc/mbxboot/rdimage.c' &&
/*
X * rdimage.c
X *
X * Dummy file to allow a compressed initrd to be added
X * into a linker section, accessed by the boot coode
X */
X
char dummy_for_rdimage;
SHAR_EOF
  $shar_touch -am 05040233100 'arch/ppc/mbxboot/rdimage.c' &&
  chmod 0644 'arch/ppc/mbxboot/rdimage.c' ||
  $echo 'restore of' 'arch/ppc/mbxboot/rdimage.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'arch/ppc/mbxboot/rdimage.c:' 'MD5 check failed'
de5a391cc4ccd1516ca4486eeeb2ff30  arch/ppc/mbxboot/rdimage.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'arch/ppc/mbxboot/rdimage.c'`"
    test 156 -eq "$shar_count" ||
    $echo 'arch/ppc/mbxboot/rdimage.c:' 'original size' '156,' 'current size' "$shar_count!"
  fi
fi
# ============= arch/ppc/mbxboot/vmlinux.lds ==============
if test -f 'arch/ppc/mbxboot/vmlinux.lds' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'arch/ppc/mbxboot/vmlinux.lds' '(file already exists)'
else
  $echo 'x -' extracting 'arch/ppc/mbxboot/vmlinux.lds' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'arch/ppc/mbxboot/vmlinux.lds' &&
OUTPUT_ARCH(powerpc)
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
/* Do we need any of these for elf?
X   __DYNAMIC = 0;    */
SECTIONS
{
X  /* Read-only sections, merged into text segment: */
X  . = + SIZEOF_HEADERS;
X  .interp : { *(.interp) }
X  .hash          : { *(.hash)		}
X  .dynsym        : { *(.dynsym)		}
X  .dynstr        : { *(.dynstr)		}
X  .rel.text      : { *(.rel.text)		}
X  .rela.text     : { *(.rela.text) 	}
X  .rel.data      : { *(.rel.data)		}
X  .rela.data     : { *(.rela.data) 	}
X  .rel.rodata    : { *(.rel.rodata) 	}
X  .rela.rodata   : { *(.rela.rodata) 	}
X  .rel.got       : { *(.rel.got)		}
X  .rela.got      : { *(.rela.got)		}
X  .rel.ctors     : { *(.rel.ctors)	}
X  .rela.ctors    : { *(.rela.ctors)	}
X  .rel.dtors     : { *(.rel.dtors)	}
X  .rela.dtors    : { *(.rela.dtors)	}
X  .rel.bss       : { *(.rel.bss)		}
X  .rela.bss      : { *(.rela.bss)		}
X  .rel.plt       : { *(.rel.plt)		}
X  .rela.plt      : { *(.rela.plt)		}
/*  .init          : { *(.init)	} =0*/
X  .plt : { *(.plt) }
X  .text      :
X  {
X    *(.text)
X    *(.fixup)
X    *(.got1)
X  }
X  _etext = .;
X  PROVIDE (etext = .);
X  .rodata    :
X  {
X    *(.rodata)
X    *(.rodata1)
X  }
X  .fini      : { *(.fini)    } =0
X  .ctors     : { *(.ctors)   }
X  .dtors     : { *(.dtors)   }
X  /* Read-write section, merged into data segment: */
X  . = (. + 0x0FFF) & 0xFFFFF000;
X  .data    :
X  {
X    *(.data)
X    *(.data1)
X    *(.sdata)
X    *(.sdata2)
X    *(.got.plt) *(.got)
X    *(.dynamic)
X    CONSTRUCTORS
X  }
X  _edata  =  .;
X  PROVIDE (edata = .);
X
X  .fixup   : { *(.fixup) }
X  __start___ex_table = .;
X  __ex_table : { *(__ex_table) }
X  __stop___ex_table = .;
X
X  . = ALIGN(32);
X  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
X
X  . = ALIGN(4096);
X  __init_begin = .;
X  .text.init : { *(.text.init) }
X  .data.init : {
X    *(.data.init);
X    __vtop_table_begin = .;
X    *(.vtop_fixup);
X    __vtop_table_end = .;
X    __ptov_table_begin = .;
X    *(.ptov_fixup);
X    __ptov_table_end = .;
X  }
X  . = ALIGN(16);
X  __setup_start = .;
X  .setup.init : { *(.setup.init) }
X  __setup_end = .;
X  __initcall_start = .;
X  .initcall.init : { *(.initcall.init) }
X  __initcall_end = .;
X  . = ALIGN(4096);
X  __init_end = .;
X
X  . = ALIGN(4096);
X  __pmac_begin = .;
X  .text.pmac : { *(.text.pmac) }
X  .data.pmac : { *(.data.pmac) }
X  . = ALIGN(4096);
X  __pmac_end = .;
X
X  . = ALIGN(4096);
X  __prep_begin = .;
X  .text.prep : { *(.text.prep) }
X  .data.prep : { *(.data.prep) }
X  . = ALIGN(4096);
X  __prep_end = .;
X
X  . = ALIGN(4096);
X  __apus_begin = .;
X  .text.apus : { *(.text.apus) }
X  .data.apus : { *(.data.apus) }
X  . = ALIGN(4096);
X  __apus_end = .;
X
X  . = ALIGN(4096);
X  __apus_begin = .;
X  .text.apus : { *(.text.apus) }
X  .data.apus : { *(.data.apus) }
X  . = ALIGN(4096);
X  __apus_end = .;
X
X  . = ALIGN(4096);
X  __openfirmware_begin = .;
X  .text.openfirmware : { *(.text.openfirmware) }
X  .data.openfirmware : { *(.data.openfirmware) }
X  . = ALIGN(4096);
X  __openfirmware_end = .;
X
X  __bss_start = .;
X  .bss       :
X  {
X   *(.sbss) *(.scommon)
X   *(.dynbss)
X   *(.bss)
X   *(COMMON)
X  }
X  _end = . ;
X  PROVIDE (end = .);
X
X  /*
X   * For loader only: Put the zImage after everything else
X   */
X  _gzstart = . ;
X  .gzimage : { *(.gzimage) }
X  _gzend   = . ;
X
X  /*
X   * For loader only: Put the initrd after zImage
X   */
X  _rdstart = . ;
X  .rdimage : { *(.rdimage) }
X  _rdend   = . ;
X
}
SHAR_EOF
  $shar_touch -am 05060231100 'arch/ppc/mbxboot/vmlinux.lds' &&
  chmod 0644 'arch/ppc/mbxboot/vmlinux.lds' ||
  $echo 'restore of' 'arch/ppc/mbxboot/vmlinux.lds' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'arch/ppc/mbxboot/vmlinux.lds:' 'MD5 check failed'
5dfe86d647b2e619ecd80dc9b32c7c65  arch/ppc/mbxboot/vmlinux.lds
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'arch/ppc/mbxboot/vmlinux.lds'`"
    test 3415 -eq "$shar_count" ||
    $echo 'arch/ppc/mbxboot/vmlinux.lds:' 'original size' '3415,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh04766
exit 0


--
------------------\\----------------------\\----------------------------
Jon Diekema        |                       | Smiths Industries
(616) 241-8310     |                       | 3290 Patterson Avenue, SE
diekema_jon@si.com \\                      \\  Grand Rapids, MI 49512-1991

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Getting the image section of the ELF file to load w/ VxWorks boot ROM
  2000-05-09 10:04 ` Frank Przybylski
  2000-05-09 15:54   ` Daniel G. Clemmensen
@ 2000-05-17 20:30   ` Dan Malek
  1 sibling, 0 replies; 6+ messages in thread
From: Dan Malek @ 2000-05-17 20:30 UTC (permalink / raw)
  To: Frank Przybylski; +Cc: linuxppc-embedded


Frank Przybylski wrote:
>
> Hi,
> I had similar problems when loading kernel images with gdb over BDM into
> an MPC.


I'm not picking on you Frank, but with all of the recent trouble
people are having loading kernels.......well, I just can't understand
why everyone is using such complex methods for development.

>From my perspective, you need a minimum of:

	1. Processor initialization software (i.e. boot rom)
	2. Some format and method for loading the Linux kernel in
		your product
	3. The Linux kernel.

So, why don't you break your development into these more simple steps?
You need processor initialization, and the BDM tools work great for
that.  Use it and get this done and out of the way.  This has nothing
to do with Linux and can be a big time sink or saver (depending upon
your methods).

If you are going to start by debugging the Linux kernel (and I don't
know why you would), at least load vmlinux (not zImage) with the
debuggers.  It is a real ELF image with all of the symbols that
every tool, including GDB will grok just fine.

Last, determine how you are going to use this in your product, then
use the code in arch/ppc/mbxboot to build something.  Hell, if you
think about it long enough and realize that others are very successful,
you may find what is currently there will work as it is or with minimal
changes.

Trying to develop an embedded Linux kernel using standard default
BDM tools and using the zImage is.....well....just about the most
difficult method.


	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-05-17 20:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-05-02 17:24 Getting the image section of the ELF file to load w/ VxWorks boot ROM diekema_jon
2000-05-03  8:07 ` Arto Vuori
2000-05-09 10:04 ` Frank Przybylski
2000-05-09 15:54   ` Daniel G. Clemmensen
2000-05-09 17:51     ` Getting the image section of the ELF file to load w/ VxWorks boot diekema_jon
2000-05-17 20:30   ` Getting the image section of the ELF file to load w/ VxWorks boot ROM Dan Malek

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 NNTP newsgroup(s).