bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/31409] New: ld arm: global/weak non-hidden symbols referenced by


From: i at maskray dot me
Subject: [Bug ld/31409] New: ld arm: global/weak non-hidden symbols referenced by R_ARM_FUNCDESC are unnecessarily exported
Date: Sat, 24 Feb 2024 07:18:12 +0000

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

            Bug ID: 31409
           Summary: ld arm: global/weak non-hidden symbols referenced by
                    R_ARM_FUNCDESC are unnecessarily exported
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: i at maskray dot me
  Target Milestone: ---

% cat a.s
.globl _start, f0, f1
.weak f2
.protected f1
_start: f0: f1: f2: fl: bx lr

.data
.long f0(FUNCDESC)
.long f1(FUNCDESC)
.long f2(FUNCDESC)
.long fl(FUNCDESC)

% ./bin/as-new --fdpic a.s -o a.o && ./bin/ld-new -m armelf_linux_fdpiceabi a.o
-pie -z noexecstack -o a
% readelf --dyn-syms a

Symbol table '.dynsym' contains 9 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 000000f4     0 SECTION LOCAL  DEFAULT    1 .interp
     2: 00000204     0 SECTION LOCAL  DEFAULT    6 .text
     3: 00000208     0 SECTION LOCAL  DEFAULT    7 .rofixup
     4: 0000128c     0 SECTION LOCAL  DEFAULT    9 .got
     5: 000012a0     0 SECTION LOCAL  DEFAULT   10 .data
     6: 00000204     0 NOTYPE  WEAK   DEFAULT    6 f2
     7: 00000204     0 NOTYPE  GLOBAL DEFAULT    6 f0
     8: 00000204     0 NOTYPE  GLOBAL PROTECTED    6 f1

In a non-FDPIC link when f0/f1/f2 are referenced by absolute relocations, 
f0/f1/f2 are not exported
(https://maskray.me/blog/2020-11-15-explain-gnu-linker-options#export-dynamic
describes the symbol export rule).

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