From: =?UTF-8?Q?=c3=81lvaro_Fern=c3=a1ndez_Rojas?= Date: Wed, 2 Aug 2017 22:35:24 +0200 Subject: [U-Boot] [PATCH v3 2/2] MIPS: Stop building position independent code In-Reply-To: References: <1610496.73fHGmXFmX@np-p-burton> <20170619185347.13959-1-paul.burton@imgtec.com> <46585f2e-ae8c-150c-f798-fcf72a30f22b@gmail.com> <3d5d22e5-c6e4-0d82-af64-3efa5d16dc15@gmail.com> <61f6e9a4-123d-9687-db2d-6264d5e7ae31@gmail.com> Message-ID: <521fae68-9e81-802f-47ca-666fc78173df@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de Hi Daniel, El 31/07/2017 a las 12:52, Daniel Schwierzeck escribió: > 2017-07-30 18:04 GMT+02:00 Álvaro Fernández Rojas : >> >> >> El 30/07/2017 a las 16:05, Daniel Schwierzeck escribió: >>> >>> >>> Am 30.07.2017 um 14:27 schrieb Álvaro Fernández Rojas: >>>> I've been a bit busy lately and I couldn't test this until now, but I have to say that this commit breaks u-boot bmips support :( >>>> >>>> BTW, I tried this on several bmips boards (one of them is a Netgear CG3100D, which uses u-boot.bin instead of u-boot.elf) >>>> >>>> Do you have any idea on what could be hapenning? >>>> >>> >>> maybe you need to specify "--emit-relocs" too when linking u-boot.elf >>> from u-boot-elf.o. But u-boot-elf.o should already contain the correct >>> .reloc section with the updated relocation entries so you don't need to >>> rerun the reloc-tool on u-boot.elf. >>> >> >> I tried that and it doesn't work. >> However, I've just found out that if I remove the relocs call it boots again... >> https://gist.github.com/Noltari/ce3a6a9dda69e74caf7ba33c9c8ade9a > > I wonder how this can work. Even the u-boot.elf now contains > position-dependent code so that an update of the relocation entries is > required there too. Without the updated entries, U-Boot can't execute > after jumping from relocate_code() to board_init_r(). Did you use a > clean build if U-Boot? > Yeah, I used a clean build of u-boot (upstream with just the patch mentioned before): https://gist.github.com/Noltari/ce3a6a9dda69e74caf7ba33c9c8ade9a#file-u-boot-log Regards, Álvaro.