]> git.baikalelectronics.ru Git - uboot.git/commit
mips: reloc: Change R_MIPS_NONE to catch pre-reloc BSS usage
authorStefan Roese <sr@denx.de>
Fri, 5 Jun 2020 08:29:25 +0000 (10:29 +0200)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Sat, 18 Jul 2020 12:23:25 +0000 (14:23 +0200)
commit693bd5c61e9da9972f745e15888f256c82f9211d
treef120239d1c9ea31f7ea298d2e7f5a85d637e9c9a
parentf4b73b200e6724c8d2927cf61c5dc19a90c986a4
mips: reloc: Change R_MIPS_NONE to catch pre-reloc BSS usage

This patch changes the R_MIPS_NONE define from 0 to a magic value. This
makes it possible to better detect any forbidden pre-relocation usage
of BSS variables, as they are often zero'ed and then relocation is
stopped too early.

Additionally the error message is improved to also print the faulting
address. This helps finding the root-cause for this breakage by
comparing this address with the values in System.map.

This patch helps a lot when working on pre-relocation code, like the
Octeon DDR init code, where such variables have hit me multiple times
now.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
arch/mips/include/asm/relocs.h
arch/mips/lib/reloc.c