object file

G

gouqizi.lvcha

Hi, All:

I have an Linux object file, for example, foobar.o. Can I know which
version
of gcc build it?

Rick
 
J

Jack Klein

Hi, All:

I have an Linux object file, for example, foobar.o. Can I know which
version
of gcc build it?

Rick

What if it was build with a COBOL compiler, and not gcc at all?

In any case, this is not a language issue, since the language doesn't
define the format of object files. Try asking in
or maybe somewhere in
 
E

E. Robert Tisdale

Rick said:
I have an Linux object file, for example, foobar.o.
Can I know which version of gcc build it?
cat foobar.cc
void foobar(void) {
}
g++ -Wall -ansi -pedantic -c foobar.cc
strings -a foobar.o
GCC: (GNU) 3.4.1
.symtab
.strtab
.shstrtab
.text
.data
.bss
.note.GNU-stack
.comment
foobar.cc
_Z6foobarv
 
P

Prawit Chaivong

Hi, All:

I have an Linux object file, for example, foobar.o. Can I know which
version
of gcc build it?

Rick


Hi,

you may need this line in your header file or cpp (up to you)

extern "C"
{
void your_asm_func();
....
....
....
}

I would add above in header file.
If you don't add you will have a problem when you link it.
Why? because c++ compiler mangle name difference from c compiler.

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,055
Members
47,659
Latest member
salragu

Latest Threads

Top