[U-Boot] [PATCH RFC] mpc8572ds relocatable

Graeme Russ graeme.russ at gmail.com
Mon Oct 13 01:55:40 CEST 2008


Wolfgang,

On Mon, Oct 13, 2008 at 9:53 AM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Ed Swarthout,
>
> In message <1220862412-16162-1-git-send-email-Ed.Swarthout at freescale.com> you wrote:
>> Fixes boot crash from bad string pointers in get_table_entry_name
>> when flash is erased or differs from current u-boot image.
>>

This is exactly the problem I am looking at for my board so I can do
flash upgrades of U-Boot from U-Boot

> Either we  add  manual  relocation  to  these  pointers  like  we  do
> elsewhere (that would be my recommendation for a quick workaround aka
> bug  fix for this release), or we should find a clean way to get real
> relocation working (that would be much better, but probably it is too
> late for this release).

I am looking into this this using gcc -fpie / ld -pie. This is used
by hardened system for address space randomization. It appears to be
very well supported by recent versions of gcc and binutils on all
platforms so appears to me to be the way to go.

The number of new sections generated in a PIE image is more than I
expected. The following sections have differences when TEXT_BASE is
changed when compiled with -fpie and linked with -pie:

.dynsym
.dynamic
.data.rel
.data.rel.local
.data.rel.ro.local
.got.plt
.got
.rel.got
.rel.text
.rel.u_boot_cmd
.rel.data.rel
.rel.data.rel.ro.local
.rel.data.rel.local

Unfortunately, not all of these appear to be record-based sections,
and may even cross-reference each other. I was looking at throwing
this in the 'too hard' basket for now, keeping -fpie / -pie and just
setting TEXT_BASE to a fixed address in RAM and look at implementing
the relocator later. However, it seems to me that implementing full,
clean relocation just keeps on popping up as a real issue.

Wolfgang - If you like, I could bump this up my priority list and get
PIE support added to lib_i386 and from there it can be ported to other
arches. Unfortunately my work to date has been for a custom i386 board
so whatever I come up with may not tie 100% cleanly into mainline. I
have been maintaining a detailed step-by-step commit path, so it
should not be that bad, but expect ~20 commits from mainline to PIE.

>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> The optimum committee has no members.
>                                                   - Norman Augustine
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>


More information about the U-Boot mailing list