This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] RISC-V: Optimize lui and auipc relaxations for undefweak symbols


On Thu, Sep 19, 2019 at 3:37 AM Nelson Chu <nelson.chu@sifive.com> wrote:

>
>
> *At first I thought that toolchain will use GOT and PLT if creating a
> shared library.Therefore, there is no harm without checking the above case
> I thought.But you are right, there may have some exceptions, and caution is
> the parent of safety :)*
>

Now that I had a little more time to look at this, it turns out that the
RISC-V port doesn't support the -z [no]dynamic-undefined-weak option.  This
is an optional feature, and only the x86 and ppc ports provide it.  I
hacked support for it in, and then noticed that we don't relax pcrel relocs
when creating shared libraries and pie output.  Also, the auipc sequence
used in pic code results in a local symbol for the addi, and you are only
setting undefined_weak for global symbols.  So the problem I was worried
about can't happen, even if we did have support for -z
[no]dynamic-undefined-weak.  So you can forget about the
UNDEF_NO_DYNAMIC_RELOC comment, it isn't relevant to your patch.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]