bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/27493] New: objcopy --weaken-symbol does not weaken undefi


From: i at maskray dot me
Subject: [Bug binutils/27493] New: objcopy --weaken-symbol does not weaken undefined symbols
Date: Mon, 01 Mar 2021 08:47:46 +0000

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

            Bug ID: 27493
           Summary: objcopy --weaken-symbol does not weaken undefined
                    symbols
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: i at maskray dot me
  Target Milestone: ---

% cat a.s
.globl def
def:
  call undef
% cc -c a.s
% objcopy --weaken-symbol=def --weaken-symbol=undef a.o b.o
% readelf -Ws b.o

Symbol table '.symtab' contains 7 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 SECTION LOCAL  DEFAULT    1 
     2: 0000000000000000     0 SECTION LOCAL  DEFAULT    3 
     3: 0000000000000000     0 SECTION LOCAL  DEFAULT    4 
     4: 0000000000000000     0 SECTION LOCAL  DEFAULT    5 
     5: 0000000000000000     0 NOTYPE  WEAK   DEFAULT    1 def
     6: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND undef

--weaken-symbol applies on a defined symbol but not on an undefined symbol.
This was originally raised as a behavior difference between objcopy and
llvm-objcopy https://bugs.llvm.org/show_bug.cgi?id=49362 .

My feeling is that weakening undefined symbols matches the documentation and
should be done. It is a behavior change but it unlikely causes any trouble.

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