Alan Modra <amo...@gmail.com> wrote on 01/10/2011 07:02:51 PM: > From: Alan Modra <amo...@gmail.com> > To: Brad Mouring <brad.mour...@ni.com> > Cc: bug-binutils@gnu.org > Date: 01/10/2011 07:03 PM > Subject: Re: [bug-binutils] Inconsistencies in symbol mapping outputfrom 'ld' > > On Mon, Jan 10, 2011 at 11:26:42AM -0600, Brad Mouring wrote: > > Using a couple of different toolchains (the default x86 2.20.1 ld > > installed in Ubuntu and clones, a pre-built third-party ARM cross compile > > toolchain's 2.19.51) results in the same, inconsistent behavior regarding > > outputting symbol mapping information. > > > > Basically, when I pass -M to ld, it behaves as I'd expect with regards to > > the --demangle and --no-demangle options. However, when using the > > -Map=FILENAME option, it seems to ignore --(no-)demangle, always > > outputting mangled symbols into the file requested. > > > > Is this expected behavior? If so, is there a mechanism (short of > > redirecting stdout to a file) to get mangled symbol information into a
> > file? > > I can't see how this could happen, nor can I reproduce the problem > with 2.20.1 or current mainline. Furthermore, my x86 system ld does > not exhibit this problem. > > $ /usr/bin/ld --version > GNU ld (GNU Binutils for Ubuntu) 2.20.1-system.20100303 > Copyright 2009 Free Software Foundation, Inc. > This program is free software; you may redistribute it under the terms of > the GNU General Public License version 3 or (at your option) a later version. > This program has absolutely no warranty. > > Is the --no-demangle option really making it to ld? > > -- > Alan Modra > Australia Development Lab, IBM I likewise was bewildered, hence my message. $ /usr/bin/ld --version GNU ld (GNU Binutils for Ubuntu) 2.20.1-system.20100303 Copyright 2009 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. $ cat test.cpp #include<stdio.h> #include<stdint.h> __attribute__ ((visibility("default"))) int32_t perfectlyCromulent(int32_t foo, int32_t bar) { return foo * bar; } int main() { perfectlyCromulent(2,3); return 0; } $ g++ -o test -Wl,-M,--demangle test.cpp |grep Cromulent 0x0000000008048494 perfectlyCromulent(int, int) $ g++ -o test -Wl,-M,--no-demangle test.cpp |grep Cromulent 0x0000000008048494 _Z18perfectlyCromulentii $ rm -f test.map && g++ -o test -Wl,-Map=test.map,--no-demangle test.cpp && grep Cromulent test.map 0x0000000008048494 _Z18perfectlyCromulentii $ rm -f test.map && g++ -o test -Wl,-Map=test.map,--demangle test.cpp && grep Cromulent test.map 0x0000000008048494 _Z18perfectlyCromulentii Granted, I did not directly call ld, but rather provided them to be passed. If direct invocation is not reproducing the problem, it seems this may be a problem with gcc or my use of gcc Brad Mouring _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils