2.6.3 compilation problem
Hi,
While compiling Linux 2.6.3 + ia64 patch for it, using the following:
[sourav]$ gcc --version
gcc (GCC) 3.1
[sourav]$ as --version
GNU assembler 2.13.90 20030125
[sourav]$ ld --version
GNU ld version 2.12.90 20020604
I get the following error while doing
make vmlinux
------
[...]
IKCFG kernel/config_data.h
CC kernel/configs.o LD kernel/built-in.o GEN .version CHK include/linux/compile.h dnsdomainname: Host name lookup failure UPD include/linux/compile.h CC init/version.o LD init/built-in.o LD .tmp_vmlinux1
drivers/built-in.o: In function `serio_close':
drivers/built-in.o(.text+0x130c02): undefined reference to `local symbols in discarded section .exit.text'drivers/built-in.o: In function `serio_init':
drivers/built-in.o(.init.text+0x10502): undefined reference to `local symbols in discarded section .exit.text'
make: *** [.tmp_vmlinux1] Error 1
[...]
--------
Any idea what I am doing wrong?
TIA
--Sourav
Did you enable CONFIG_HOTPLUG in your .config file?
Enable it and compile it again.
Yanmin
Quoted 54 lines
-----Original Message-----
From: [email protected] [mailto:linux-ia64- [email protected]] On Behalf Of Sourav Sen
Sent: 2004年3月11日 14:53
To: [email protected]
Subject: 2.6.3 compilation problemHi,
While compiling Linux 2.6.3 + ia64 patch for it, using the following:
[sourav]$ gcc --version
gcc (GCC) 3.1
[sourav]$ as --version
GNU assembler 2.13.90 20030125
[sourav]$ ld --version
GNU ld version 2.12.90 20020604I get the following error while doing
make vmlinux------
[...]
IKCFGkernel/config_data.hCC kernel/configs.o LD kernel/built-in.o GEN .version CHK include/linux/compile.h dnsdomainname: Host name lookup failure UPD include/linux/compile.h CC init/version.o LD init/built-in.o LD .tmp_vmlinux1
drivers/built-in.o: In function `serio_close':
drivers/built-in.o(.text+0x130c02): undefined reference to `local symbols in
discarded section .exit.text'drivers/built-in.o: In function `serio_init':
drivers/built-in.o(.init.text+0x10502): undefined reference to `local symbols in discarded section .exit.text'
make: *** [.tmp_vmlinux1] Error 1
[...]
--------Any idea what I am doing wrong?
TIA
--Sourav-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
To workaround the problem, you can append __attribute__((weak)) to the declaration of those discarded symbols defined in section ".exit.text".
Another workaround is to keep section ".exit.text" by modifying arch/ia64/vmlinux.lds.S.
The device driver author might be able to answer why it is written that way.
Thanks,
Pingping (Benjamin) Liu
Intel China Software Center
Quoted 57 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sourav Sen
Sent: 2004Äê3ÔÂ11ÈÕ 14:53
To: [email protected]
Subject: 2.6.3 compilation problemHi,
While compiling Linux 2.6.3 + ia64 patch for it, using the following:
[sourav]$ gcc --version
gcc (GCC) 3.1
[sourav]$ as --version
GNU assembler 2.13.90 20030125
[sourav]$ ld --version
GNU ld version 2.12.90 20020604I get the following error while doing
make vmlinux------
[...]
IKCFGkernel/config_data.hCC kernel/configs.o LD kernel/built-in.o GEN .version CHK include/linux/compile.h dnsdomainname: Host name lookup failure UPD include/linux/compile.h CC init/version.o LD init/built-in.o LD .tmp_vmlinux1
drivers/built-in.o: In function `serio_close':
drivers/built-in.o(.text+0x130c02): undefined reference to `local symbols in
discarded section .exit.text'drivers/built-in.o: In function `serio_init':
drivers/built-in.o(.init.text+0x10502): undefined reference to `local symbols in discarded section .exit.text'
make: *** [.tmp_vmlinux1] Error 1
[...]
--------Any idea what I am doing wrong?
TIA
--Sourav-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Liu, Benjamin wrote on Thu, March 11, 2004 12:33 AM
To workaround the problem, you can append __attribute__((weak)) to the declaration of those discarded symbols defined in section ".exit.text".
The device driver author might be able to answer why it is written that way.
The linker gets the award for least informative in this case, and it just plain misleading. The culprit isn't the one printed. It lies somewhere else.
- Ken
Sourav,
Could you please send out your configure file in attachment? I can not reproduce your issue even when I configured CONFIG_SERIO.
Ken, it's too early to make any judgement.
Thanks,
Pingping (Benjamin) Liu
Intel China Software Center
Quoted 27 lines
-----Original Message-----
From: Chen, Kenneth W
Sent: 2004Äê3ÔÂ12ÈÕ 2:38
To: Liu, Benjamin; Sourav Sen; [email protected]
Subject: RE: 2.6.3 compilation problemQuoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Liu, Benjamin wrote on Thu, March 11, 2004 12:33 AM
To workaround the problem, you can append
__attribute__((weak)) to the
Quoted 1 line
declaration of those discarded symbols defined in section
".exit.text".
Quoted 2 lines
The device driver author might be able to answer why it is
written that
Quoted 1 line
way.
The linker gets the award for least informative in this case, and it just
plain misleading. The culprit isn't the one printed. It lies somewhere
else.- Ken
From my very old binutils release note:
---
3. Update handling relocations against the discarded sections. You may need to apply the kernel patch enclosed here to your kernel source. If you still see things like
drivers/char/char.o(.data+0x46b4): undefined reference to `local symbols in discarded section .text.exit'
in the final kernel link, that means you have compiled a driver into the kernel which has a reference to the symbol in a discarded section. Please check all the builtin drivers and search for things like
static struct pci_driver xxx_pci_driver = {
...
remove: xxx_remove,
...
};
Then check to see if xxx_remove is marked with __devexit like
static void __devexitxxx_remove (struct pci_dev *dev)
{
...
}
which means it will be discarded if the driver is builtin. If xxx_remove may be discarded, please make sure there is
#ifdef MODULE
remove: xxx_remove,
#endif
so that xxx_remove won't be included when the driver is builtin.
---
Hope it help.
H.J.
Quoted 42 lines · Benjamin
Sourav,
Could you please send out your configure file in attachment? I can not reproduce your issue even when I configured
CONFIG_SERIO.Ken, it's too early to make any judgement.
Thanks,
Pingping (Benjamin) Liu
Intel China Software CenterQuoted 17 lines
-----Original Message-----
From: Chen, Kenneth W
Sent: 2004年3月12日 2:38
To: Liu, Benjamin; Sourav Sen; [email protected]
Subject: RE: 2.6.3 compilation problemQuoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Liu, Benjamin wrote on Thu, March 11, 2004 12:33 AM
To workaround the problem, you can append
__attribute__((weak)) to the
Quoted 1 line
declaration of those discarded symbols defined in section
".exit.text".
Quoted 2 lines
The device driver author might be able to answer why it is
written that
Quoted 1 line
way.
Quoted 10 lines
The linker gets the award for least informative in this case, and it just
plain misleading. The culprit isn't the one printed. It lies somewhere
else.- Ken
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Liu, Benjamin on Thu, March 11, 2004 7:53 PM
Could you please send out your configure file in
attachment? I can not reproduce your issue even
when I configuredCONFIG_SERIO.Ken, it's too early to make any judgement.
Seen this before, and I just don't have the time to track down exactly which module was the culprit. And no, it's not from serio.
Quoted 8 lines · H. J. Lu
which means it will be discarded if the driver is builtin. If
xxx_removemay be discarded, please make sure there is#ifdef MODULE
remove:xxx_remove,
#endifso that
xxx_removewon't be included when the driver is builtin.
remove: __devexit_p(xxx_remove),
is the correct method. The pointer is required for CONFIG_MODULE _or_ CONFIG_HOTPLUG, otherwise it must be set to NULL. __devexit_p() does all that.
Yes, I agree.
Thanks,
Pingping (Benjamin) Liu
Intel China Software Center
Quoted 27 lines
-----Original Message-----
From: Keith Owens [mailto:[email protected]]
Sent: 2004Äê3ÔÂ12ÈÕ 14:01
To: H. J. Lu
Cc: Liu, Benjamin; Chen, Kenneth W; Sourav Sen;
[email protected]
Subject: Re: 2.6.3 compilation problemQuoted 8 lines · H. J. Lu
which means it will be discarded if the driver is builtin. If
xxx_removemay be discarded, please make sure there is#ifdef MODULE
remove:xxx_remove,
#endifso that
xxx_removewon't be included when the driver is builtin.remove: __devexit_p(xxx_remove),is the correct method. The pointer is required for
CONFIG_MODULE_or_CONFIG_HOTPLUG, otherwise it must be set to NULL.__devexit_p()does all that.
The linker's error report is kind of misleading in this case, there is no discarded reference from serio_close/serio_init.
To workaround the problem, we can reserve "exit.text" into final vmlinux image, which will enlarge the image size a little bit. I've attached the patch.
Another way is to upgrade binutils package, newer linker will report warning instead of error for this case.
Thanks,
Pingping (Benjamin) Liu
Intel China Software Center
Quoted 80 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Liu, Benjamin
Sent: 2004年3月11日 16:33
To: Sourav Sen; [email protected]
Subject: RE: 2.6.3 compilation problemTo workaround the problem, you can append __attribute__((weak)) to the declaration of those discarded symbols defined in section ".exit.text".
Another workaround is to keep section ".exit.text" by modifying
arch/ia64/vmlinux.lds.S.The device driver author might be able to answer why it is written that way.
Thanks,
Pingping (Benjamin) Liu
Intel China Software CenterQuoted 48 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sourav Sen
Sent: 2004年3月11日 14:53
To: [email protected]
Subject: 2.6.3 compilation problemHi,
While compiling Linux 2.6.3 + ia64 patch for it, using the following:
[sourav]$ gcc --version
gcc (GCC) 3.1
[sourav]$ as --version
GNU assembler 2.13.90 20030125
[sourav]$ ld --version
GNU ld version 2.12.90 20020604I get the following error while doing
make vmlinux------
[...]
IKCFGkernel/config_data.hCC kernel/configs.o LD kernel/built-in.o GEN .version CHK include/linux/compile.h dnsdomainname: Host name lookup failure UPD include/linux/compile.h CC init/version.o LD init/built-in.o LD .tmp_vmlinux1
drivers/built-in.o: In function `serio_close':
drivers/built-in.o(.text+0x130c02): undefined reference to `local symbols in
discarded section .exit.text'drivers/built-in.o: In function `serio_init':
drivers/built-in.o(.init.text+0x10502): undefined reference to `local symbols in discarded section .exit.text'
make: *** [.tmp_vmlinux1] Error 1
[...]
--------Any idea what I am doing wrong?
Quoted 9 lines
TIA
--Sourav-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
ia64/kernel/vmlinux.lds.S renamed from ia64/kernel/vmlinux.lds.S.old +1 -1
@@ -16,7 +16,6 @@ { /* Sections to be discarded */ /DISCARD/ : { - *(.exit.text) *(.exit.data) *(.exitcall.exit) *(.IA_64.unwind.exit.text)
@@ -36,6 +35,7 @@ *(.text.ivt) *(.text) *(.gnu.linkonce.t*) + *(.exit.text) } .text2 : AT(ADDR(.text2) - LOAD_OFFSET) { *(.text2) }