bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/25527] [RISC-V] -static-pie not producing relocations


From: wilson at gcc dot gnu.org
Subject: [Bug ld/25527] [RISC-V] -static-pie not producing relocations
Date: Tue, 11 Feb 2020 01:21:40 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=25527

Jim Wilson <wilson at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-02-11
                 CC|                            |wilson at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jim Wilson <wilson at gcc dot gnu.org> ---
I see two problems here.

The first problem is that the RISC-V GCC port isn't handling the --static-pie
option.  For targets that support it, --static-pie should be translated to the
linker options "--static --pie --no-dynamic-linker -z text".  This doesn't
happen for RISC-V as the gcc support is missing.

The second problem is that if I manually specify the missing linker options
then I get a linker error "-pie is not supported".  We do not have support for
shared libraries in our embedded toolchain because no one has done a RISC-V
shared library port of newlib yet.  I get binutils testsuite errors if I enable
shared library support, which makes it harder to spot testsuite regressions. 
Also, I used to get bug reports from users asking why the shared library
support was broken because they couldn't get it working.  It isn't broken, it
is because the newlib support is missing.

If I use a linux toolchain, and manually specify the missing linker options,
then it works correctly.  But the linux toolchain isn't designed for bare metal
targets so that probably isn't usable as a workaround.

The GCC bug should be fixed and looks easy enough.

You could hack around the binutils problem by reverting the patch that disabled
shared library support in the embedded elf toolchain.  Or maybe I should
consider re-enabling the support and find some other way to handle the newlib
and testsuite problems.  You don't need shared libraries to make static pie
work.  And the boot loader folks would also like to be able to use static pie
or something similar.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]