Skip to contentSkip to conversation

Linker error : linking constant-gp files with non-constant gp fil

Linux-ia64 Sistla, Krishnakanth V 3 participants 3 messages May 8, 2001

lore
Share & tools
lore
#0 lore raw

Hi all,

I am trying to write a miscellanious driver and compile it into the
linux
kernel. When i try to link two object files created by the below
mentioned
commands (during a build) i get the following error. could some help
me
please ?

Thanx in advance
KK

---------------------------------------------
kernel version

linux-2.4.0test10-001115

--------------------------command sequence--

gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fno-strict-aliasing
-fomit-frame-pointer -pipe -Wa,-x -ffixed-r13 -mfixed-rangeñ0-f15,f32-f127 -funwind-tables
-mconstant-gp -c -o ia64pmon.o test.c

gcc -D__KERNEL__ -I/usr/src/linux/include -c -o ia64pmon_s.o test_s.S

ld -r -o misc.o test.o test_s.o

ld: test_s.o: linking constant-gp files with non-constant-gp files Bad value: failed to merge target specific data of the file test_s.o

----------------------------------------------------------------------------
------------------

#1 lore raw

Re: [Linux-ia64] Linker error : linking constant-gp files with non-constant gp fil es

All objects that are linked into the kernel must be compiled with -mconstant-gp. All objects that are linked into modules must not be compiled with -mconstant-gp. Set your compile flags accordingly.

#2 lore raw

Re: [Linux-ia64] Linker error : linking constant-gp files with non-constant gp fil es

In reply to Sistla, Krishnakanth V
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Keith Owens

Keith> All objects that are linked into the kernel must be compiled Keith> with -mconstant-gp. All objects that are linked into modules Keith> must not be compiled with -mconstant-gp. Set your compile Keith> flags accordingly.

That's not sufficient. You need to use pretty much *all* the flags that normal kernel compiles use, in particular the -mfixed* options are important.

	--david