* config/mh-sparc.h: now uses libgcc.a
authorSteve Chamberlain <sac@cygnus>
Wed, 29 Jan 1992 16:43:16 +0000 (16:43 +0000)
committerSteve Chamberlain <sac@cygnus>
Wed, 29 Jan 1992 16:43:16 +0000 (16:43 +0000)
* ldmain.c: quit using exit
* *.sc: use *(COMMON) rather than [COMMON]
* ldlex.l, lexsup.c: much thinking moved from .l and put into .c,
to allow preprocessing of .l file.
* Makefile.in: New ldlex.l mangling
* ldexp.c (fold_binary): perform expressions with % and / in
integer.
* ldfile.c (open_a): open archives on VMS in a special way
* lderror.c: forgot to check in from a long while ago

14 files changed:
ld/ChangeLog
ld/Makefile.in
ld/config/sparc.mh
ld/ebmon29k.sc
ld/h8300hds.sc
ld/i386aout.sc
ld/lderror.c [new file with mode: 0644]
ld/ldgld.sc
ld/ldgld68k.sc
ld/ldgld960.sc
ld/ldglda29k.sc
ld/ldlnk960.sc
ld/ldm88k.sc
ld/news.sc

index f500821d89c4d657442129f1a81c226b9f479a45..e1d7a2d584327182bc72ac5654a2493f66328b25 100644 (file)
@@ -1,3 +1,16 @@
+Wed Jan 29 08:35:39 1992  Steve Chamberlain  (sac at rtl.cygnus.com)
+
+       * config/mh-sparc.h: now uses libgcc.a
+       * ldmain.c: quit using exit
+       * *sc: use *(COMMON) rather than [COMMON]
+       * ldlex.l, lexsup.c: much thinking moved from .l and put into .c,
+       to allow preprocessing of .l file.
+       * Makefile.in: New ldlex.l mangling
+       * ldexp.c (fold_binary): perform expressions with % and / in
+       integer.
+       * ldfile.c (open_a): open archives on VMS in a special way
+
+
 Tue Jan 28 10:18:16 1992  Steve Chamberlain  (sac at rtl.cygnus.com)
 
        * ldgram.y: map -M behave in the same way as -Map (sets file name
index d82aa44335ca8afb5e866644c0189ade35813116..a62c33246ebe96a679812e03f66c2fdb99195eca 100644 (file)
@@ -160,7 +160,7 @@ SED_REMOVE_CONSTRUCTORS= -e /CONSTRUCTORS/d
 BFDLIB=$(unsubdir)/../bfd$(subdir)/libbfd.a
 LIBIBERTY=$(unsubdir)/../libiberty$(subdir)/libiberty.a
 
-OFILES= ldgram.o ldlex.o ldlang.o ldctor.o ldmain.o ldindr.o \
+OFILES= ldgram.o ldlex.o lexsup.o ldlang.o ldctor.o ldmain.o ldindr.o \
        ldwarn.o ldwrite.o ldexp.o ldlnk960.o ld__gld68k.o ld__i386aout.o \
        ld__m88k.o ld__glda29k.o ld__news.o h8300hds.o ld__ebmon29k.o \
        ld__gld.o ldgld960.o ldemul.o ldver.o ldmisc.o ldsym.o \
@@ -173,7 +173,7 @@ HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
 
 MANSOURCES=ld.tex
 
-LDCSOURCES=ldlang.c ldctor.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
+LDCSOURCES=ldlang.c lexsup.c ldctor.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
        ld__gld.c ld__gld68k.c ld__m88k.c ld__ebmon29k.c \
        ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \
        ldvanilla.c relax.c  lderror.c
@@ -200,7 +200,13 @@ ldgram.h ldgram.c: ldgram.y
        mv -f y.tab.h ldgram.h
 
 ldlex.c: ldlex.l
-       lex -t $(VPATH)/ldlex.l >ldlex.c 
+       /lib/cpp -E -P $(INCLUDES)  $(HDEFINES) $(TDEFINES) $(CDEFINES) $(VPATH)/ldlex.l >ldlex.p
+       lex -t ldlex.p >ldlex.q
+       sed -e "s/define input/define old_input/" \
+            -e "s/define unput/define old_unput/" \
+           -e "s/input/lex_input/" \
+            -e "s/unput/lex_unput/" <ldlex.q >ldlex.c
+
 
 # These all start with ld__ so 'make clean' can find them.
 
index 7e4094da638fe47d3c662b7818a3f944896e893a..b44661b135b039f2a98258eb0c9706d5bbeff2a5 100755 (executable)
@@ -2,6 +2,6 @@ YACC=yacc -tvd
 #CC=gcc -Wall -ansi
 #stuff for self hosting
 HOSTING_CRT0=/lib/crt0.o
-HOSTING_LIBS=/usr/latest/lib/gcc/sun4/libgnu.a  -lc
+HOSTING_LIBS=/usr/latest/lib/gcc/sun4/libgcc.a  -lc
 HOSTING_EMU=LDEMULATION=gld; export LDEMULATION
 
index 2852c16d6328822d8ff769158dea4a7dc8cb036d..da1a76a5cdf2d0d26abe985cfa3e739b2c4e730c 100755 (executable)
@@ -19,7 +19,7 @@ SECTIONS {
        .bss  . :
                { 
 
-               [COMMON]        
+               *(COMMON)       
                *(.bss);
                _end = .;
                 } 
index d0a139b06a089d355460dadafd5a5d7ba98fbe1e..052776666016c07ee943b4bc2dcd7b5718094b80 100755 (executable)
@@ -15,7 +15,7 @@ SECTIONS
 .bss . :
        {                                       
        *(.bss)                         
-       [COMMON]                                
+       *(COMMON)                               
         _end = .;                              
        }                                       
 }
index 82133cc85f82367e7cd43633e2471b87ca24b9f1..9ea8e6405ce658007ddcf132c6458f0bba5df3a5 100755 (executable)
@@ -19,7 +19,7 @@ SECTIONS
   .bss SIZEOF(.data) + ADDR(.data) :
   {
     *(.bss)
-    [COMMON]
+    *(COMMON)
     _end = .;
   }
 }
diff --git a/ld/lderror.c b/ld/lderror.c
new file mode 100644 (file)
index 0000000..30946df
--- /dev/null
@@ -0,0 +1,82 @@
+#include "bfd.h"
+#include "sysdep.h"
+#include "../bfd/seclet.h"
+#include "ld.h"
+
+#define MAX_ERRORS_IN_A_ROW 5
+
+extern ld_config_type config;
+
+extern bfd_error_vector_type bfd_error_vector;
+
+
+/* BFD has failed to link something, give a better error message */
+
+static void
+DEFUN(ld_undefined_symbol,(relent, seclet),
+      CONST arelent *relent AND
+      bfd_seclet_type *seclet)
+{
+  asymbol *s = *(relent->sym_ptr_ptr);
+  static asymbol *error_symbol;
+  static unsigned int error_count;
+  if (seclet != (bfd_seclet_type *)NULL)
+  {
+    
+    asection *section = seclet->u.indirect.section;
+    bfd *abfd = section->owner;
+
+
+    /* We remember the symbol, and never print more than
+       a reasonable number of them in a row */
+    if (s == error_symbol) {
+       error_count++;
+      }
+    else {
+       error_count = 0;
+       error_symbol = s;
+      }
+    if (error_count < MAX_ERRORS_IN_A_ROW) {
+       einfo("%C: undefined reference to `%T'\n",
+             abfd,section, seclet->u.indirect.symbols,
+             relent->address, s);
+       config.make_executable = false;
+
+      }
+    else if (error_count == MAX_ERRORS_IN_A_ROW) {
+       einfo("%C: more undefined references to `%T' follow\n",
+             abfd, section,
+             seclet->u.indirect.symbols, 
+             relent->address, s);
+      }                    
+    else {
+       /* Don't print any more */
+      }
+  }
+  else 
+  {
+    einfo("undefined reference to %s\n", (*(relent->sym_ptr_ptr))->name);
+  }
+}
+static void
+DEFUN(ld_reloc_truncated,(relent, seclet),
+      CONST arelent *relent AND
+      bfd_seclet_type *seclet)
+{
+  asymbol *s = *(relent->sym_ptr_ptr);
+  asection *section = seclet->u.indirect.section;
+  bfd *abfd = section->owner;
+  
+  einfo("%X%C: relocation truncated to fit %R\n",
+       abfd, section, seclet->u.indirect.symbols, relent->address, relent);
+
+}
+  
+
+void
+DEFUN_VOID(init_bfd_error_vector)
+{
+bfd_error_vector.undefined_symbol = ld_undefined_symbol;  
+bfd_error_vector.reloc_value_truncated = ld_reloc_truncated;
+
+}
index 15ff71fc383ad4c6dc3fc3a8305665ae8884742e..eb87b330ad0de1f70cefc001cc1cf9fd36420f83 100755 (executable)
@@ -21,7 +21,7 @@ SECTIONS
   .bss   SIZEOF(.data) + ADDR(.data) : 
     {                                  
       *(.bss)                          
-       [COMMON]                                
+       *(COMMON)                               
          _end = .;                             
       __end = .;                               
     }                                  
index cb7a5baa272713d84eeefcf84672d17d46eb9b1e..9d7df2d5c8c19ed91be4dd46d469f0cb37f5a22c 100755 (executable)
@@ -22,7 +22,7 @@ SECTIONS
   .bss   SIZEOF(.data) + ADDR(.data) : 
   {                                    
    *(.bss)                             
-   [COMMON]                            
+   *(COMMON)                           
      _end = .;                         
      __end = .;                                
     }                                  
index 1c40a732e775af795ab9651d8870a245b88a16a9..449d3fa1d5d2cfe6378834437043964643764cdd 100755 (executable)
@@ -17,7 +17,7 @@ SECTIONS
   { 
        _bss_start = .;
        *(.bss)  
-       [COMMON] 
+       *(COMMON) 
        _end = . ; 
    } 
 } 
index ed7544c0c57894f126d8c16bb96e87a713cdbe98..26e09cf4a7ae3394207991573522adec8cbfc7f6 100755 (executable)
@@ -29,7 +29,7 @@ SECTIONS
   .bss   SIZEOF(.data) + ADDR(.data) : 
   {                                    
    *(.bss)                             
-   [COMMON]                            
+   *(COMMON)                           
      __end = ALIGN(0x8);                               
   } 
   .mstack  : { } > mstack
index f498412f6f3e5670d7e3d3539adbcac55f1c4788..409d1b99a36949c0eceff52f63960ba70b061b77 100755 (executable)
@@ -15,7 +15,7 @@ _edata = .;
   { 
    _bss_start = . ;
    *(.bss)  
-   [COMMON] 
+   *(COMMON)
     } 
 _end = . ; 
 } 
index cc123c85d2db77e23f3d4e7eb65d4072d3b1508b..1e0203f45b37ed3e92612235459dc41c62682e63 100755 (executable)
@@ -42,7 +42,7 @@ SECTIONS
   .bss   SIZEOF(.data) + ADDR(.data) : 
     {          
       *(.bss)  
-      [COMMON]         
+      *(COMMON)        
       _end = .;                                
       ___end = .;
     }                                  
index 5113f021b15239a50e0a9df1db3441f9784d1b6d..9bf3af719fa1a1b7ab40de848c80d2f61c5d35ca 100755 (executable)
@@ -22,7 +22,7 @@ SECTIONS
   .bss   SIZEOF(.data) + ADDR(.data) : 
   {                                    
    *(.bss)                             
-   [COMMON]                            
+   *(COMMON)                           
      _end = .;
      __end = .;
   }