aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1992-01-29 16:43:16 +0000
committerSteve Chamberlain <sac@cygnus>1992-01-29 16:43:16 +0000
commitcbbdbb9f2933a0d6d64faeaa72e6e75b3fa720a3 (patch)
tree9b693a141b18c7ea2ebad591a6ec8d2020f3e399
parent4cc027e126e19853730d7bfefac948e4ff8bdc91 (diff)
downloadgdb-cbbdbb9f2933a0d6d64faeaa72e6e75b3fa720a3.zip
gdb-cbbdbb9f2933a0d6d64faeaa72e6e75b3fa720a3.tar.gz
gdb-cbbdbb9f2933a0d6d64faeaa72e6e75b3fa720a3.tar.bz2
* 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 * lderror.c: forgot to check in from a long while ago
-rw-r--r--ld/ChangeLog13
-rw-r--r--ld/Makefile.in12
-rwxr-xr-xld/config/sparc.mh2
-rwxr-xr-xld/ebmon29k.sc2
-rwxr-xr-xld/h8300hds.sc2
-rwxr-xr-xld/i386aout.sc2
-rw-r--r--ld/lderror.c82
-rwxr-xr-xld/ldgld.sc2
-rwxr-xr-xld/ldgld68k.sc2
-rwxr-xr-xld/ldgld960.sc2
-rwxr-xr-xld/ldglda29k.sc2
-rwxr-xr-xld/ldlnk960.sc2
-rwxr-xr-xld/ldm88k.sc2
-rwxr-xr-xld/news.sc2
14 files changed, 115 insertions, 14 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index f500821..e1d7a2d 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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
diff --git a/ld/Makefile.in b/ld/Makefile.in
index d82aa44..a62c332 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -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.
diff --git a/ld/config/sparc.mh b/ld/config/sparc.mh
index 7e4094d..b44661b 100755
--- a/ld/config/sparc.mh
+++ b/ld/config/sparc.mh
@@ -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
diff --git a/ld/ebmon29k.sc b/ld/ebmon29k.sc
index 2852c16..da1a76a 100755
--- a/ld/ebmon29k.sc
+++ b/ld/ebmon29k.sc
@@ -19,7 +19,7 @@ SECTIONS {
.bss . :
{
- [COMMON]
+ *(COMMON)
*(.bss);
_end = .;
}
diff --git a/ld/h8300hds.sc b/ld/h8300hds.sc
index d0a139b..0527766 100755
--- a/ld/h8300hds.sc
+++ b/ld/h8300hds.sc
@@ -15,7 +15,7 @@ SECTIONS
.bss . :
{
*(.bss)
- [COMMON]
+ *(COMMON)
_end = .;
}
}
diff --git a/ld/i386aout.sc b/ld/i386aout.sc
index 82133cc..9ea8e64 100755
--- a/ld/i386aout.sc
+++ b/ld/i386aout.sc
@@ -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
index 0000000..30946df
--- /dev/null
+++ b/ld/lderror.c
@@ -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;
+
+}
diff --git a/ld/ldgld.sc b/ld/ldgld.sc
index 15ff71f..eb87b33 100755
--- a/ld/ldgld.sc
+++ b/ld/ldgld.sc
@@ -21,7 +21,7 @@ SECTIONS
.bss SIZEOF(.data) + ADDR(.data) :
{
*(.bss)
- [COMMON]
+ *(COMMON)
_end = .;
__end = .;
}
diff --git a/ld/ldgld68k.sc b/ld/ldgld68k.sc
index cb7a5ba..9d7df2d 100755
--- a/ld/ldgld68k.sc
+++ b/ld/ldgld68k.sc
@@ -22,7 +22,7 @@ SECTIONS
.bss SIZEOF(.data) + ADDR(.data) :
{
*(.bss)
- [COMMON]
+ *(COMMON)
_end = .;
__end = .;
}
diff --git a/ld/ldgld960.sc b/ld/ldgld960.sc
index 1c40a73..449d3fa 100755
--- a/ld/ldgld960.sc
+++ b/ld/ldgld960.sc
@@ -17,7 +17,7 @@ SECTIONS
{
_bss_start = .;
*(.bss)
- [COMMON]
+ *(COMMON)
_end = . ;
}
}
diff --git a/ld/ldglda29k.sc b/ld/ldglda29k.sc
index ed7544c..26e09cf4 100755
--- a/ld/ldglda29k.sc
+++ b/ld/ldglda29k.sc
@@ -29,7 +29,7 @@ SECTIONS
.bss SIZEOF(.data) + ADDR(.data) :
{
*(.bss)
- [COMMON]
+ *(COMMON)
__end = ALIGN(0x8);
}
.mstack : { } > mstack
diff --git a/ld/ldlnk960.sc b/ld/ldlnk960.sc
index f498412..409d1b9 100755
--- a/ld/ldlnk960.sc
+++ b/ld/ldlnk960.sc
@@ -15,7 +15,7 @@ _edata = .;
{
_bss_start = . ;
*(.bss)
- [COMMON]
+ *(COMMON)
}
_end = . ;
}
diff --git a/ld/ldm88k.sc b/ld/ldm88k.sc
index cc123c8..1e0203f 100755
--- a/ld/ldm88k.sc
+++ b/ld/ldm88k.sc
@@ -42,7 +42,7 @@ SECTIONS
.bss SIZEOF(.data) + ADDR(.data) :
{
*(.bss)
- [COMMON]
+ *(COMMON)
_end = .;
___end = .;
}
diff --git a/ld/news.sc b/ld/news.sc
index 5113f02..9bf3af7 100755
--- a/ld/news.sc
+++ b/ld/news.sc
@@ -22,7 +22,7 @@ SECTIONS
.bss SIZEOF(.data) + ADDR(.data) :
{
*(.bss)
- [COMMON]
+ *(COMMON)
_end = .;
__end = .;
}