-----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