Re: Etherboot 5.5

Michael Brown <[email protected]>
Newsgroups gmane.network.etherboot.devel
Message-ID <[email protected]>
On Sat, 21 May 2005, Georg Baum wrote:
> > Your gcc versions > 3.2.3 are suffering from the same problem with
> > unnamed struct elements as Tim; I will fix these in the morning, and
> > then look at the pre-3.2.3 builds.
> Meanwhile I have a fix for gcc 3.3, 3.4 and 4.0, it is attached. It is 
> ready to be applied IMO, with one exception:
> gcc 4.0 does not allow casts on lvalues. Therefore I got rid of them at 
> several places. The change in src/proto/http.c leads to cleaner code 
> actually, but the other changes are not optimal: I am not sure whether 
> the changes in src/drivers/net/natsemi.c and src/drivers/net/sis900.c are 
> correct, and the change in src/proto/nmb.c should work but is pretty 
> ugly.

Thanks.  I've applied a (very) slightly modified version of this patch.

> Unfortunately I get now an internal linker error:
> 
> $ make bin/e1000.dsk
> ld -N  -T arch/i386/scripts/i386.lds  -u obj_dskprefix --defsym 
> check_obj_dskprefix=obj_dskprefix   -u obj_e1000 --defsym 
> check_obj_e1000=obj_e1000   -u obj_config --defsym 
> check_obj_config=obj_config   bin/blib.a -o bin/e1000.dsk.tmp \
>         -Map bin/e1000.dsk.tmp.map
> ld: internal error ../../ld/ldlang.c 1974
> make: *** [bin/e1000.dsk.tmp] Error 1
> 
> $ ld -v
> GNU ld version 2.15
> 
> Do I need a newer version?

Shouldn't do; I'm using 2.13.90.0.18.

This error occurs in the following portion of code in ldlang.c:

  /* Return the iteration when the definition of NAME was last updated.  A
     value of -1 means that the symbol is not defined in the linker script
     or the command line, but may be defined in the linker symbol table.  */

  int
  lang_symbol_definition_iteration (const char *name)
  {
    struct lang_definedness_hash_entry *defentry
      = (struct lang_definedness_hash_entry *)
      bfd_hash_lookup (&lang_definedness_table, name, FALSE, FALSE);

    /* We've already created this one on the presence of DEFINED in the
       script, so it can't be NULL unless something is borked elsewhere in
       the code.  */
    if (defentry == NULL)
=====>  FAIL (); <======

    return defentry->iteration;
  }


So, it looks as though something is borked in ld.  You could try the 
attached patch to arch/i386/scripts/i386.lds, which temporarily removes 
all uses of DEFINED() in the linker script.  If this fixes the problem, 
then we're closer to identifying what's wrong with ld.

Michael
temp.diff (text/plain, 1.5 KB)
Index: arch/i386/scripts/i386.lds
===================================================================
RCS file: /cvsroot/etherboot/etherboot/etherboot-5.5/src/arch/i386/scripts/i386.lds,v
retrieving revision 1.10
diff -u -r1.10 i386.lds
--- arch/i386/scripts/i386.lds	27 Apr 2005 12:24:39 -0000	1.10
+++ arch/i386/scripts/i386.lds	23 May 2005 23:59:03 -0000
@@ -63,7 +63,7 @@
      * The prefix
      */
 
-    _prefix_link_addr = DEFINED ( _prefix_link_addr ) ? _prefix_link_addr : 0;
+    _prefix_link_addr = 0;
     . = _prefix_link_addr;
     _prefix = .;
 
@@ -80,8 +80,7 @@
      * The decompressor (may be absent)
      */
 
-    _decompress_link_addr = DEFINED ( _decompress_link_addr ) ?
-			      _decompress_link_addr : 0;
+    _decompress_link_addr = 0;
     . = _decompress_link_addr;
     _decompress = .;
 
@@ -97,7 +96,7 @@
      * The text sections
      */
 
-    _text_link_addr = DEFINED ( _text_link_addr ) ? _text_link_addr : 0;
+    _text_link_addr = 0;
     . = _text_link_addr;
     _text = .;
 
@@ -126,7 +125,7 @@
      * The data sections
      */
 
-    _data_link_addr = DEFINED ( _data_link_addr ) ? _data_link_addr : .;
+    _data_link_addr = .;
     . = _data_link_addr;
     _data = .;
 
@@ -179,8 +178,8 @@
      * location counter.
      */
 
-    _max_align		    = DEFINED ( _max_align ) ? _max_align : 16;
-    _load_addr		    = DEFINED ( _load_addr ) ? _load_addr : 0;
+    _max_align		    = 16;
+    _load_addr		    = 0;
 
     .			    = _load_addr;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.