bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/28926] New: objcopy --weaken-symbol does not weaken STB_GN


From: i at maskray dot me
Subject: [Bug binutils/28926] New: objcopy --weaken-symbol does not weaken STB_GNU_UNIQUE symbols
Date: Mon, 28 Feb 2022 00:56:09 +0000

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

            Bug ID: 28926
           Summary: objcopy --weaken-symbol does not weaken STB_GNU_UNIQUE
                    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: ---

echo '.data; .type x, @gnu_unique_object; x:' | as - -o a.o
objcopy -W x a.o
readelf -Ws a.o

The symbol 'x' remains STB_GNU_UNIQUE:

Symbol table '.symtab' contains 2 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 OBJECT  UNIQUE DEFAULT    2 x

I think with the explicit request, it makes sense to weaken 'x'.

The documentation for --weaken is:

      --weaken
           Change all global symbols in the file to be weak.  This can be
useful when building an object which will be linked against other objects using
the -R option to the linker.  This option is only effective when using an
object file format which supports weak symbols.

If we consider STB_GNU_UNIQUE "global", then --weaken probably should weaken
STB_GNU_UNIQUE, too.

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