[llvm-bugs] [Bug 49362] New: Should --weaken-symbol(s) be prevented from marking undef globals as weak?

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 26 04:00:19 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=49362

            Bug ID: 49362
           Summary: Should --weaken-symbol(s) be prevented from marking
                    undef globals as weak?
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-objcopy/strip
          Assignee: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: alexander.v.shaposhnikov at gmail.com,
                    jake.h.ehrlich at gmail.com,
                    jh7370.2008 at my.bristol.ac.uk,
                    llvm-bugs at lists.llvm.org, rupprecht at google.com

GNU objcopy --weaken-symbol does not change mentioned symbols to STB_WEAK
binding if they are undefined. This means --weaken-symbol=globalundef will do
nothing. For llvm-objcopy, if a symbol is explicitly requested by
--weaken-symbol it goes ahead with it, even for undefined symbols. This seems
like a reasonable thing to do on the surface - the user has asked to do
something so we should let them (plus there's no other way to convert a global
undef to a weak). However, it gets more complicated when you consider
interactions with --regex and --wildcard: it a user specifies
--weaken-symbol=.*, should it change weak undefined symbols? If there are any
undefined symbols, they'll become weak undefined symbols, which means there may
be problems at link time.

What do people think? I'm inclined to leave this difference in place, but am
happy to here the opinions of others.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210226/3ff8ebed/attachment.html>


More information about the llvm-bugs mailing list