From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Thu, 16 Jan 2014 21:27:15 +0100 Subject: [U-Boot] [PATCH] board_r - fixup functions table after relocation In-Reply-To: <1389894525.2768.13.camel@abrodkin-8560l.internal.synopsys.com> References: <1389784796-5584-1-git-send-email-abrodkin@synopsys.com> <20140115224348.789fb6c9@lilith> <1389894525.2768.13.camel@abrodkin-8560l.internal.synopsys.com> Message-ID: <20140116212715.5f3d3301@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Alexey, On Thu, 16 Jan 2014 17:48:45 +0000, Alexey Brodkin wrote: > On Wed, 2014-01-15 at 22:43 +0100, Albert ARIBAUD wrote: > > Hi Alexey, > > > > On Wed, 15 Jan 2014 15:19:56 +0400, Alexey Brodkin > > wrote: > > > > > "init_sequence_r" is just an array that consists of compile-time > > > adresses of init functions. Since this is basically an array of integers > > > (pointers to "void" to be more precise) it won't be modified during > > > relocation - it will be just copied to new location as it is. > > > > IIRC, in ARM we switched from GOT to ELF relocation precisely so that > > data would be relocated as well as code, and I think it actually is, > > otherwise we'd have a lot of complains. Therefore I fail to understand > > the statements above. Can someone tell me what I'm getting wrong? > > Unfortunately I don't have any supported in U-Boot ARM board handy and > run U-boot on another architecture at all (Synopsys DesignWare ARC) so > I'm not sure if on ARM functions from "init_sequence_r" list are > executed from "RAM" (i.e. from location where they were relocated). Yes, they are. > I use GOT relocation and see following outputs. GOT relocation does not relocate references within data, contrary to ELF. > Maybe it's just my faulty implementation of relocation but it might be > that nobody ever noticed this because I think only initcalls are > affected. Well, initcalls are quite essential, I guess. When you say "my faulty implementation of relocation"... do you mean some implementation different from what is currently in mainline? > -Alexey Amicalement, -- Albert.