This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [Fwd: Error: subtraction of two symbols ....]
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc at gcc dot gnu dot org, monojit at cal dot interrasystems dot com, amodra at bigpond dot net dot au
- Date: Thu, 14 Nov 2002 13:31:14 -0500 (EST)
- Subject: Re: [Fwd: Error: subtraction of two symbols ....]
> On Fri, Nov 08, 2002 at 05:47:36PM +0530, Monojit Roy wrote:
> > I am getting number of error messages like
> >
> > /var/tmp//cck237p3.s: Assembler messages:
> > /var/tmp//cck237p3.s:65938: Error: subtraction of two symbols in
> > different sections `$$dyncall' {*UND* section} - `L$8172' {.text section}
> > at file address 240288
>
> This is likely an error in the assembler. What version of
No, what is going on here is that gcc was built or configured with
the HP assembler. Unfortunately, different code needs to be output
for millicode calls with the two assemblers. A difference of two
symbols is used with the HP assembler. With GAS, we use a pc-relative
call using $PIC_pcrel$0. On the 32-bit SOM port, GAS accepts the symbol
difference but it generates incorrect relocations that fail if the
object is linked into a shared library. The 32-bit and 64-bit
ELF ports don't accept the symbol difference technique for long
millicode calls. So, you need to adjust the PATH that you are using
or put a link to the HP assembler in the gcc installation directory.
Building the hppa64-hp-hpux11 port with the HP assembler was and still
is not recommended. This recent patch
<http://gcc.gnu.org/ml/gcc-patches/2002-11/msg00631.html>
fixed a variety of problems related to building with the HP assembler.
Before that, building with the HP assembler was not supported (see
installation documentation with 3.2). It might have worked at one time
but there were so many other things broken at that point that it's hard
to say that it really worked.
The HP assembler doesn't support weak symbols and was never
really designed for use with ELF. I am fairly certain that HP
doesn't use it either since libc is full of weak symbols. This
is the main reason that we don't recommend the HP assembler. It
also doesn't support the SET directive, hiding symbols, etc.
The GNU C++ implementation is much better with weak support.
The hppa64-hp-hpux11 port is still relatively new and evolving as
bugs and problems get fixed. At the moment, the best combination
of software is the current mainline cvs for gcc, the GNU assembler
and the HP linker. There are a bunch of problems with the GNU
linker that need fixing.
Take a look at <http://gcc.gnu.org/ml/gcc-testresults/2002-11/msg00501.html>
to see the exact configuration that I recommend. Note the enabling
of the LD_INIT_SWITCH and LD_FINI_SWITCH defines in pa/pa64-hpux.h.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)