All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1] Refactor linker-generated arrays
Date: Sat, 16 Feb 2013 19:20:00 +0100	[thread overview]
Message-ID: <20130216192000.7434cbdc@lilith> (raw)
In-Reply-To: <510FAC65.7090301@gmail.com>

Hi Andreas,

On Mon, 04 Feb 2013 13:41:09 +0100, "Andreas Bie?mann"
<andreas.devel@googlemail.com> wrote:

> Hi Albert,
> 
> On 02.02.2013 18:02, Albert ARIBAUD wrote:
> > Refactor linker-generated array code so that symbols
> > which were previously linker-generated are now compiler-
> > generated. This causes relocation records of type
> > R_ARM_ABS32 to become R_ARM_RELATIVE, which makes
> > code which uses LGA able to run before relocation as
> > well as after.
> > 
> > Note: this affects more than ARM targets, as linker-
> > lists span possibly all target architectures, notably
> > PowerPC.
> > 
> > Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
> 
> Tested on avr32. The patch seems to work (basic shell testing), however
> it generates an aliasing warning:
> 
> ---8<---
> abiessmann at azuregos % PATH=$AVR32_PATH:$PATH BUILD_DIR=/tmp/build_avr32
> MAKEALL_LOGDIR=/tmp/LOG BUILD_NCPUS=4 BUILD_NBUILDS=4 ./MAKEALL atstk1002
> Configuring for atstk1002 board...
>    text	   data	    bss	    dec	    hex	filename
>  116315	   8972	 211900	 337187	  52523	/tmp/build_avr32/atstk1002/u-boot
> env_callback.c: In function 'find_env_callback':
> env_callback.c:47: warning: dereferencing pointer 'clbkp' does break
> strict-aliasing rules
> env_callback.c:44: note: initialized from here
> env_callback.c:46: note: initialized from here
> --->8---
> 
> I think it has something to do with tha fact that you re-cast the
> anonymous struct 'start' here:
> 
> ---8<---
> #define ll_entry_start(_type, _list)
> ({
> 	static struct {} start __aligned(4) __attribute__((unused,
> 		section(".u_boot_list_2_"#_list"_1")));
> 	(_type *)&start;
> })
> --->8---
> 
> I think other gcc-4.4 users will see the same error. Currently I have no
> time to dive into this.

I have dug into it and found a way to avoid GCC 4.4 or below to warn
about aliasing, by replacing 'struct {}' with 'char[0]' as the
0-byte-size type.

I still have some warnings through, regarding some regions not being
declared:

avr32-ld:built in linker script:15: warning: memory region `FLASH' not
declared
avr32-ld:built in linker script:69: warning: memory region
`CPUSRAM' not declared

It appears 'normal' in that without my patch, the same error occurs;
but I'd prefer that you confirm whether you have the same warnings on
your side.

> Best regards
> 
> Andreas Bie?mann

Amicalement,
-- 
Albert.

  parent reply	other threads:[~2013-02-16 18:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-02 17:02 [U-Boot] [PATCH v1 0/1] Get rid of R_ARM_ABS32 relocation records Albert ARIBAUD
2013-02-02 17:02 ` [U-Boot] [PATCH v1] Refactor linker-generated arrays Albert ARIBAUD
2013-02-02 17:51   ` Daniel Schwierzeck
2013-02-02 17:53     ` Marek Vasut
2013-02-02 18:30   ` Heiko Schocher
2013-02-02 18:42   ` Jeroen Hofstee
2013-02-04  8:21   ` Heiko Schocher
2013-02-04  8:51     ` Albert ARIBAUD
2013-02-04 12:41   ` Andreas Bießmann
2013-02-04 14:22     ` Albert ARIBAUD
2013-02-16 18:20     ` Albert ARIBAUD [this message]
2013-02-18 10:39       ` Andreas Bießmann
2013-02-18 10:42         ` Andreas Bießmann
2013-02-18 16:48           ` Albert ARIBAUD
2013-02-25 10:58   ` [U-Boot] [PATCH v2 0/4] Get rid of R_ARM_ABS32 relocation records Albert ARIBAUD
2013-02-25 10:58     ` [U-Boot] [PATCH v2 1/4] arm: omap: map u_boot_lists section to .sram Albert ARIBAUD
2013-02-25 10:58       ` [U-Boot] [PATCH v2 2/4] Remove linker lists (LGAs) from SPL linker scripts Albert ARIBAUD
2013-02-25 10:58         ` [U-Boot] [PATCH v2 3/4] arm: make __bss_start and __bss_end__ compiler-generated Albert ARIBAUD
2013-02-25 10:59           ` [U-Boot] [PATCH v2 4/4] Refactor linker-generated arrays Albert ARIBAUD
2013-02-25 11:32     ` [U-Boot] [PATCH v2 0/4] Get rid of R_ARM_ABS32 relocation records Marek Vasut
2013-02-25 15:19     ` Tom Rini
2013-02-25 16:20       ` Daniel Schwierzeck
2013-03-13 18:39         ` Tom Rini
2013-02-25 17:22       ` Albert ARIBAUD
2013-03-13 21:15     ` Albert ARIBAUD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130216192000.7434cbdc@lilith \
    --to=albert.u.boot@aribaud.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.