[coreboot] Relocable payloads

Rudolf Marek r.marek at assembler.cz
Thu Feb 25 01:03:58 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I have taken memtest reloc.c and glued it into libpayload. Check attached patch.
It adds -fPIC too.

Then I taken the tint payload and make it dynamic via:

../libpayload/bin/lpgcc -shared -o tint.elf tint.o engine.o io.o utils.o

I added -shared to following rule

$(TARGET).elf: $(OBJS)
    $(CC) -shared -o $@ $(OBJS)

And -fPIC to CFLAGS

I used Qemu to test this. And it does start tint! Then I changed the loading
address with attached simple patch coreboot_change_base.patch and STILL does
work! I think I have more luck than I thought.

(Except the stack, I cheated and created the temp 4K stack, but I think this can
be fixed quite easily)

Questions:

1) Does it work really work? I can't believe it.

2) If yes I think we will need to ask Eric to re-license this for libpayload

3) I think we can use this to make coreboot_ram to run on ANY address :) if
someone manages to add -fPIC to our build system. When the coreboot_ram is
created one need to add -shared too.

Rudolf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuFvm4ACgkQ3J9wPJqZRNWrFQCfddjeN0irx6eljQYIBSdYodkf
Rm0An2DlZGK7MG+6vqH+APlVKLHLAwzT
=7Nyh
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make_reloc.patch
Type: text/x-diff
Size: 12277 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100225/74e22d3a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coreboot_change_base.patch
Type: text/x-diff
Size: 1332 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100225/74e22d3a/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make_reloc.patch.sig
Type: application/octet-stream
Size: 72 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100225/74e22d3a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coreboot_change_base.patch.sig
Type: application/octet-stream
Size: 72 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100225/74e22d3a/attachment-0001.obj>


More information about the coreboot mailing list