[Top][All Lists]

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

[Bug ld/24685] [RISCV] R_RISCV_CALL_PLT should not create a canonical PL

From: wilson at gcc dot gnu.org
Subject: [Bug ld/24685] [RISCV] R_RISCV_CALL_PLT should not create a canonical PLT in -no-pie mode
Date: Tue, 25 Jun 2019 01:08:40 +0000


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

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-06-25
                 CC|                            |wilson at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jim Wilson <wilson at gcc dot gnu.org> ---
Looks like the problem is in riscv_elf_finish_dynamic_symbol where we have
          /* If the symbol is weak, we do need to clear the value.              
             Otherwise, the PLT entry would provide a definition for            
             the symbol even if the symbol wasn't defined anywhere,             
             and so the symbol would never be NULL.  */
          if (!h->ref_regular_nonweak)
            sym->st_value = 0;

The well maintained targets all have check for !h->pointer_equality_needed in
addition to or instead of the !h->ref_regular_nonweak check.  It looks like
this pointer_equality_needed check is missing from a lot of ports, but maybe
not all of them support linux shared libraries.

So we need code to set h->pointer_equality_needed correctly based on relocs
seen, and then a simple check to clear sym->st_value if pointer_equality_needed
is zero.

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]