bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/27153] New: ld riscv: Emit R_RELATIVE_IRELATIVE instead of R_JUM


From: i at maskray dot me
Subject: [Bug ld/27153] New: ld riscv: Emit R_RELATIVE_IRELATIVE instead of R_JUMP_SLOT for -Bsymbolic
Date: Wed, 06 Jan 2021 06:43:35 +0000

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

            Bug ID: 27153
           Summary: ld riscv: Emit R_RELATIVE_IRELATIVE instead of
                    R_JUMP_SLOT for -Bsymbolic
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: i at maskray dot me
  Target Milestone: ---

Very minor issue.

.globl func
.type func, @gnu_indirect_function
func:
  ret

.globl _start
_start:
  call func

ld -shared -Bsymbolic can use R_RELATIVE_IRELATIVE instead of R_JUMP_SLOT


     if (h->dynindx == -1
          || ((bfd_link_executable (info)
               || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
              && h->def_regular
              && h->type == STT_GNU_IFUNC))
        {
          info->callbacks->minfo (_("Local IFUNC function `%s' in %pB\n"),
                                  h->root.root.string,
                                  h->root.u.def.section->owner);

          /* If an STT_GNU_IFUNC symbol is locally defined, generate
             R_RISCV_IRELATIVE instead of R_RISCV_JUMP_SLOT.  */
          asection *sec = h->root.u.def.section;
          rela.r_info = ELFNN_R_INFO (0, R_RISCV_IRELATIVE);
          rela.r_addend = h->root.u.def.value
                          + sec->output_section->vma
                          + sec->output_offset;


It'd be very helpful to introduce a preemptible bit. I think similar checks
exist in many places.

-- 
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]