This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Assembler failure under Solaris





Hi!

The program below will cause an error when compiling under SunOS 5.6
(i.e. Solaris).  It will, however, compile fine under SunOS 5.7.

The error is different depending on whether the -g option is present
on the command line.

Obviously, the assemblers are different in the two versions of the
operating system, but gcc should be able to generate code suitable for
both of them.

Gcc: version 2.95.2

Command line: "g++ test2.cpp" and "g++ -g test2.cpp", respectively.

    -- Anders Lindgren, IAR Systems

---------------------8<================== Compile time error (no -g)
/usr/ccs/bin/as: "/var/tmp/ccKgFOZ8.s", line 1831: error: can't compute value of an expression involving an external symbol
/usr/ccs/bin/as: "/var/tmp/ccKgFOZ8.s", line 2045: error: can't compute value of an expression involving an external symbol
---------------------8<================== Link time error (with -g)
#include <map>
#include <string>

map<string, string> * myMap;

int main()
{
  myMap->erase("foo");
}
---------------------8<==================
ld: warning: relocation error: R_SPARC_32: file /var/tmp/ccBjScgQ.o: symbol _:
        external symbolic relocation against non-allocatable section .stab;
        cannot be processed at runtime: relocation ignored
Undefined                       first referenced
 symbol                             in file
_                                   /var/tmp/ccBjScgQ.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
---------------------8<==================

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]