[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: difference between default behaviour of GNU nm and AIX nm (symbol
From: |
Laurent Vivier |
Subject: |
Re: difference between default behaviour of GNU nm and AIX nm (symbol demangling) |
Date: |
Tue, 25 Jun 2002 11:27:26 +0200 |
I did like that because there is already a lot of test on archicture in
libtool.m4
grep "case \$host" libtool.m4|wc
36 110 764
;-)
so it's very simple...
otherwise, I have to test the following example, but it's ok between AIX
and GNU/linux, but it can failed on other architecture (for instance,
"__Fl" gives "(long)" on AIX and linux, but "__FL" gives "(long long)"
on AIX and "__FL" on GNU/linux"). The issue is to find the test that can
behave correctly on all architectures (I have only AIX and GNU/linux),
so it's better to test directly the architecture, I think.
$ cat test_nm.c
int this_is__FL(void)
{
return 0;
}
int this_is__Fl(void)
{
return 0;
}
$ cc -c test_nm.c
******************GNU/LINUX******************
----GOOD----
$ nm -B test_nm.o
00000000 t gcc2_compiled.
00000000 T this_is__FL
00000010 T this_is__Fl
----BAD ----
$ nm -BC test_nm.o
00000000 t gcc2_compiled.
00000000 T this_is__FL
00000010 T this_is(long)
*********************AIX*********************
----BAD ----
$ nm -B test_nm.o
40 T .this_is(long long)
0 T .this_is(long)
80 d TOC
84 d this_is(long long)
100 D this_is(long long)
80 d this_is(long)
88 D this_is(long)
----GOOD----
$ nm -BC test_nm.o
40 T .this_is__FL
0 T .this_is__Fl
80 d TOC
84 d this_is__FL
100 D this_is__FL
80 d this_is__Fl
88 D this_is__Fl
David Lee wrote:
>
> On Mon, 24 Jun 2002, Laurent Vivier wrote:
>
> > I think GNU nm has the same behaviour on every platform (linux, solaris,
> > hp, and so on).
> > I want to use libtool on AIX with native AIX nm that hasn't the same
> > behaviour.
> > Libtool has been developed for GNU nm, so if I want to use AIX nm, I
> > need to pass good arguments to have same behaviour as GNU nm.
> > I can't test only GNU nm or not because I don't know how acts nm on
> > solaris, hp or other.
> > So I test "AIX", if AIX I know "special case !", and to be sure I test
> > it's not GNU nm (because it can be installed instead of native AIX nm)
>
> As I understand the recommendations, the test you write would ideally be
> for the behaviour of "nm" and/or of its arguments on that system. In your
> case, your test would:
> 1. invoke "nm ... -C ...", not worrying about whose "nm" it is;
> 2. determine which way it behaved;
> 3. set something according to that behaviour.
>
> That description makes no mention of any particular OS; we should try to
> avoid mention of OS-specific things. Nor does it mention gnu/not-GNU.
> You can imagine the (non-)availability of GNU "nm" as being an OS-like
> variant, and therefore, if reasonably possible, should avoid explicit
> mention of it.
>
> (Note to experts: I think I got that about right, didn't I? Feel free to
> correct!)
>
> Hope that helps.
>
> --
>
> : David Lee I.T. Service :
> : Systems Programmer Computer Centre :
> : University of Durham :
> : http://www.dur.ac.uk/t.d.lee/ South Road :
> : Durham :
> : Phone: +44 191 374 2882 U.K. :
--
-------------- Laurent Vivier ---------------
mailto:address@hidden
phone: (+33) 476 29 7866 Bullcom: 229-7866
--------------BULL/FREC:B1-226---------------
When we speak of free software, we are refer-
ring to freedom, not price. (in GPL:Preamble)
-------------- BI&S/GeODE/AIX ---------------