public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: Christophe Lyon <christophe.lyon@linaro.org>,
	binutils <binutils@sourceware.org>,
	gcc@gcc.gnu.org
Subject: Re: [arm] Too strict linker assert?
Date: Tue, 09 Apr 2019 22:30:00 -0000	[thread overview]
Message-ID: <78f68a64-5ad9-31aa-1c3f-b65f3d1a9584@foss.arm.com> (raw)
In-Reply-To: <CAKdteOZCwjc9apmmtfKeOne-E3D1ucWtMsQCafrK6mejpKa0rw@mail.gmail.com>

On 09/04/2019 13:26, Christophe Lyon wrote:
> Hi,
> 
> While building a newlib-based arm-eabi toolchain with
> --with-multilib-list=rmprofile, I faced a linker assertion failure in
> elf32_arm_merge_eabi_attributes (bfd/elf32-arm.c):
> BFD_ASSERT (in_attr[Tag_ABI_HardFP_use].i == 0)
> 
> I traced this down to newlib's impure.o containing only data, and thus
> GCC does not emit a .fpu directive when compiling impure.c.
> 
> When the linker merges impure.o's attributes with the other
> contributions that already have
> Tag_FP_arch, this assertion fails because in my multilib case (-mthumb
> -march=armv7e-m+fp -mfloat-abi=softfp) all the object files have
>   Tag_ABI_HardFP_use: SP only
> 
> Put differently, all objects but impure.o have
>   Tag_ABI_HardFP_use: SP only
>   Tag_FP_arch: VFPv4-D16
> but impure.o has only:
>   Tag_ABI_HardFP_use: SP only
> (and no Tag_FP_arch)
> 
> Removing the linker assertion makes the build succeed, so I guess my
> question is: should I submit a linker patch to remove the assert
> because it is too strict, or should I find a way to make GCC emit the
> needed .fpu directive?
> 
> Thanks,
> 
> Christophe
> 

I think removing the assert will remove entirely the check that a user
is not mixing code with incompatible ABIs.  So probably this is a bug.

Which version of GCC were you using, and which version of binutils?  I
thought I'd addressed this when doing the rework of the FPU option code;
but perhaps I've missed something somewhere.  I'll check in more detail
tomorrow.

R.

  reply	other threads:[~2019-04-09 22:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 12:27 Christophe Lyon
2019-04-09 22:30 ` Richard Earnshaw [this message]
2019-04-10  9:16   ` Christophe Lyon
2019-04-10  9:42     ` Richard Earnshaw (lists)
2019-04-10 11:28       ` Christophe Lyon

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=78f68a64-5ad9-31aa-1c3f-b65f3d1a9584@foss.arm.com \
    --to=richard.earnshaw@foss.arm.com \
    --cc=binutils@sourceware.org \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc@gcc.gnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).