From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Beno=C3=AEt_Th=C3=A9baudeau?= Date: Wed, 15 May 2013 01:58:23 +0200 (CEST) Subject: [U-Boot] [PATCH 0/5] Optimize ARM relocation In-Reply-To: <20130514221601.1b0e939e@lilith> References: <1368561780-19104-1-git-send-email-albert.u.boot@aribaud.net> <20130514221601.1b0e939e@lilith> Message-ID: <293223900.823433.1368575903550.JavaMail.root@advansee.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Albert, On Tuesday, May 14, 2013 10:16:01 PM, Albert ARIBAUD wrote: > On Tue, 14 May 2013 22:02:55 +0200, Albert ARIBAUD > wrote: > > > *** NOTE: this series applies over the 'Factorize > > ARM relocate_code instances' series. > > > > This series optimizes relocation by ensuring ARM > > binaries only use one type of relocation record, > > R_ARM_RELATIVE., then optimizing relocation code > > accordingly. > > > > The only known case where relocation records other > > than R_ARM_RELATIVE are generated is when a reference > > is made to a symbol defined in the linker script, e.g. > > __image_copy_start, __image_copy_end, __rel_dyn_start, > > __rel_dyn_end, and __dynsym_start. > > > > Moving the definition of these symbols from the linker > > scripts into a C module causes their references' types > > to become R_ARM_RELATIVE. > > > > First, arch/arm/lib/bss.c is replaced by a more generic > > arch/arm/lib/sections.c where all section symbols will > > be defined. > > > > Second, __image_copy_start and __image_copy_end symbols > > are moved from linker scripts to arch/arm/lib/sections.c > > > > Third, __rel_dyn_start, __rel_dyn_end and __synsym_start > > are moved from linker scripts into arch/arm/lib/sections.c > > > > Fourth, a check is added to the build system to ensure > > that ELF U-Boot binaries only use R_ARM_RELATIVE records. > > > > Last, relocate_code is optimized > > Hmm, it seems I need to see my work posted on the list to discover how > I could have done it better... I just noticed that if ARM binaries only > have R_ARM_RELATIVE record types, then all the .dynsym sections can > actually be dropped from the binaries. So, if I reorder the series and > put patch 5/5 first, then I can eliminate patch 3/5, or more to the > point, replace it with one which eliminates all dynsym stuff from linker > scripts, further reducing code size. That'll go in V2... Indeed. Best regards, Beno?t