From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Schwierzeck Date: Fri, 5 Jun 2020 17:51:42 +0200 Subject: [PATCH] mips: reloc: Change R_MIPS_NONE to catch pre-reloc BSS usage In-Reply-To: <20200605082925.4559-1-sr@denx.de> References: <20200605082925.4559-1-sr@denx.de> Message-ID: <82176ea9-1d84-0216-b103-e0e6c83cff8e@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 05.06.20 um 10:29 schrieb Stefan Roese: > 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 > Cc: Daniel Schwierzeck > Cc: Aaron Williams > Cc: Chandrakala Chavva > --- > arch/mips/include/asm/relocs.h | 2 +- > arch/mips/lib/reloc.c | 7 ++++--- > 2 files changed, 5 insertions(+), 4 deletions(-) > applied to u-boot-mips/next, thanks. BTW: in case the relocation table is cutted off, you can increase the size with CONFIG_MIPS_RELOCATION_TABLE_SIZE. -- - Daniel