[Top][All Lists]

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

Re: objcopy --globalize-symbols on MinGW [PATCH]

From: Wesley W. Terpstra
Subject: Re: objcopy --globalize-symbols on MinGW [PATCH]
Date: Fri, 26 Sep 2008 18:36:28 +0200

On Fri, Sep 26, 2008 at 1:55 PM, Wesley W. Terpstra <address@hidden> wrote:
I've traced binutils 2.18.50-cvs20080109 (debian mingw package)
> and the line 1074 (sym->flags &= ~ (BSF_GLOBAL | BSF_WEAK); does get
> run but the result object still has BFS_GLOBAL set. So I suspect this
> is a binutils/bfd bug.

I've traced the bug down (it was a bug). The problem is that if a
symbol being written has an existing 'native' symbol (which is always
the case for objcopy) the coffgen.c ignores any BFS_* flags set by the
utility. This prevents both ld and objcopy (and probably any other
binutil which manipulates symbol visibility) from changing global
symbols to local, but also weakening symbols or globalizing them. If
the symbol was newly created, it has no native information and so the
sclass gets set correctly.

The attached patch compares the desired BFS_{GLOBAL,LOCAL,WEAK} state
against the classification of the native symbol. If these differ, it
overwrites the sclass in the same way a new symbol would have been

Is this the right place to send a binutils patch? And could someone
familiar with the binutils coffgen please check it over?

Attachment: coff-change-symbol-class.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]