2

The Linux file command provides info about an executable, for example:
"/home/foo: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped"

I am specifically interested in the "for GNU/Linux 2.6.9" portion of that output. What determines that?

Given that I have two machines, both with gcc 4.6 installed, but one has a 2.6.9 Linux kernel and the other has a 3.2.0 Linux Kernel.
If I compile a .o or a .a file on the 2.6.9 machine, and then I take that over to the 3.2.0 machine, could I even link it into an executable built there? If I linked it in, would the kernel version of my executable still be 3.2.0?

1 Answer 1

1

This is the kernel version which is got from the machine, the binary was compiled and packaged during the build process. This is a possible duplicate of the link

Sign up to request clarification or add additional context in comments.

2 Comments

@JohannesWeiß 's answer was interesting, but I don't think it addressed the core of my question. For example you say the kernel version is from the machine the binary was compiled on. Which "binary" are you referring to? If I link a .o or .a that was compiled on a 2.6.9 Linux kernel into the compilation process of a binary on a 3.2.0 Linux kernel what would happen?
I believe the file command should show 3.2.0 as its the version of the kernel you are building/linking/running on.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.