This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ld segfault while compiling Linux/alpha 2.6 with CVS trunk


On Thu, Sep 18, 2003 at 11:00:18AM -0700, Richard Henderson wrote:
> On Thu, Sep 18, 2003 at 01:19:46PM -0400, Daniel Jacobowitz wrote:
> > Is the bug likely to be:
> >   - the creation of the .got section in the object?
> 
> This one is likely to have caused ...
> 
> >   - the linker crash?
> 
> ... this one.
> 
> >   - both?
> 
> Of course the linker crash is a bug.
> 
> The .got section creation thing is something that the module creation
> code on alpha-linux does (severe hackery due to not using ld to link).
> I was not aware that it was legal to try to link module code directly
> into the main kernel, however...

Ahah....

The same module appears to be included in netfilter's
CONFIG_IP_NF_COMPAT_IPCHAINS module and in CONFIG_IP_NF_NAT.  So the
code ends up built as if it were going into a module.  But the .config
had CONFIG_IP_NF_COMPAT_IPCHAINS=y, so it got linked into the kernel.
That's how we get the bad object.

That suggests that this is the ld bug, attached.  I don't bother
checking for the flags, I don't think it matters...

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-09-18  Daniel Jacobowitz  <drow@mvista.com>

	* elf64-alpha.c (elf64_alpha_create_got_section): Initialize
	->got if the section already exists.

--- /home/troup/binutils/src/bfd/elf64-alpha.c	Wed Sep 17 17:43:53 2003
+++ /home/dan/elf64-alpha.c	Thu Sep 18 20:40:08 2003
@@ -2467,8 +2467,13 @@ elf64_alpha_create_got_section(abfd, inf
 {
   asection *s;
 
-  if (bfd_get_section_by_name (abfd, ".got"))
-    return TRUE;
+  if ((s = bfd_get_section_by_name (abfd, ".got")))
+    {
+      /* Check for a non-linker created .got?  */
+      if (alpha_elf_tdata (abfd)->got == NULL)
+	alpha_elf_tdata (abfd)->got = s;
+      return TRUE;
+    }
 
   s = bfd_make_section (abfd, ".got");
   if (s == NULL


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]