From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/9] arm: work around assembler bug
Date: Thu, 6 Sep 2012 05:03:00 +0200 [thread overview]
Message-ID: <201209060503.02037.marex@denx.de> (raw)
In-Reply-To: <1345066741-19613-3-git-send-email-amartin@nvidia.com>
Dear Allen Martin,
> Disable sibling call optimization based on binutils version. This is
> to work around a bug in the assember in binutils versions < 2.22.
> Branches to weak symbols can be incorrectly optimized in thumb mode to
> a short branch (b.n instruction) that won't reach when the symbol gets
> preempted.
CC Albert ... Albert, let's pull this in as a part of this series.
I'm fine with it.
> http://sourceware.org/bugzilla/show_bug.cgi?id=12532
>
> Signed-off-by: Allen Martin <amartin@nvidia.com>
> ---
> arch/arm/config.mk | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/arch/arm/config.mk b/arch/arm/config.mk
> index 3f4453a..24b9d7c 100644
> --- a/arch/arm/config.mk
> +++ b/arch/arm/config.mk
> @@ -87,3 +87,21 @@ endif
> ifndef CONFIG_NAND_SPL
> LDFLAGS_u-boot += -pie
> endif
> +
> +#
> +# FIXME: binutils versions < 2.22 have a bug in the assembler where
> +# branches to weak symbols can be incorrectly optimized in thumb mode
> +# to a short branch (b.n instruction) that won't reach when the symbol
> +# gets preempted
> +#
> +# http://sourceware.org/bugzilla/show_bug.cgi?id=12532
> +#
> +ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
> +ifeq ($(GAS_BUG_12532),)
> +export GAS_BUG_12532:=$(shell if [ $(call binutils-version) -lt 0222 ] ; \
> + then echo y; else echo n; fi)
> +endif
> +ifeq ($(GAS_BUG_12532),y)
> +PLATFORM_RELFLAGS += -fno-optimize-sibling-calls
> +endif
> +endif
Best regards,
Marek Vasut
next prev parent reply other threads:[~2012-09-06 3:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-15 21:38 [U-Boot] [PATCH v3 0/9] enable thumb for tegra20 Allen Martin
2012-08-15 21:38 ` [U-Boot] [PATCH v3 1/9] tools, config.mk: add binutils-version Allen Martin
2012-09-02 15:05 ` Wolfgang Denk
2012-09-04 20:30 ` Allen Martin
2012-08-15 21:38 ` [U-Boot] [PATCH v3 2/9] arm: work around assembler bug Allen Martin
2012-09-06 3:03 ` Marek Vasut [this message]
2012-08-15 21:38 ` [U-Boot] [PATCH v3 3/9] tegra20: remove inline assembly for u32 cast Allen Martin
2012-08-15 21:38 ` [U-Boot] [PATCH v3 4/9] arm: add _thumb1_case_uqi to libgcc Allen Martin
2012-08-15 21:38 ` [U-Boot] [PATCH v3 5/9] arm: use thumb compatible return in arm720t Allen Martin
2012-08-15 21:38 ` [U-Boot] [PATCH v3 6/9] arm: change arm720t to armv4t Allen Martin
2012-08-15 21:38 ` [U-Boot] [PATCH v3 7/9] arm720t: add linkage macro for relocate_code Allen Martin
2012-08-15 21:39 ` [U-Boot] [PATCH v3 8/9] arm: use thumb interworking returns in libgcc Allen Martin
2012-08-15 21:39 ` [U-Boot] [PATCH v3 9/9] tegra20: enable thumb build Allen Martin
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=201209060503.02037.marex@denx.de \
--to=marex@denx.de \
--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.