-O2 issue with g++ version 3.3.3

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

 



Hi,

In the course of my work in the OpenHPI project, I've encountered a problem
with g++ version 3.3.3 that I narrowed down to a -O2 flag behavior which is
different from other g++ versions both older and newer.

Here is an excerpt of the real file - let's call it buggpp.cpp - that
exhibits the behavior:

// new plugin_loader
extern "C" {

// ABI Interface functions
static void *
IpmiOpen( void *handler_config )
{
  return handler_config;
}

}

extern "C" {

void * oh_open (void *) _attribute_ ((weak, alias("IpmiOpen")));

}

I compile it with the following command: "g++ -O2 -c buggpp.cpp -o buggpp.o"

With g++ version 3.2.3 (Redhat EL 3.0), 3.4.4 (Fedora Core 3) and 4.0.1
(Fedora Core 4) the output of "nm buggpp.o" is the following:

00000000 t IpmiOpen
00000000 W oh_open

But with g++ version 3.3.3 (Suse Linux ES 9.0) I get:

         U IpmiOpen

In the real project, it creates an error in the application since it cannot
find oh_open symbol when trying to load the library including this code.

If I remove -O2, I get the same output as with other versions but it's not a
viable solution for me.

Is it a known issue with g++ 3.3.3? If yes, is there a fix available?

TIA,
Pierre





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux