aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ld/Makefile.in31
-rwxr-xr-xld/ldgldm88kbcs.c3
-rwxr-xr-xld/ldgldm88kbcs.script50
3 files changed, 45 insertions, 39 deletions
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 6dfab10..36d31be 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -8,7 +8,7 @@ srcdir = .
destdir = /usr/local
-version=`awk '{print substr ($$4, 2, length ($$4) - 3); }' $(srcdir)/../gcc/version.c`
+version=`$(srcdir)/../gcc$(subdir)/gcc -dumpversion`
prefix = $(destdir)
bindir = $(prefix)/bin
libdir = $(prefix)/lib
@@ -68,10 +68,10 @@ LDCSOURCES=ldlang.c ldmain.c ldwrite.c ldlnk960.c ldgld.c ldgld68k.c \
ldgldm88kbcs.c \
ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c ldvanilla.c
-GENERATED_SOURCES=ldgramtb.c ldlex.c ldgramtb.h
-GENERATED_HEADERS=ldgramtb.h
+GENERATED_SOURCES=ldgram.c ldlex.c ldgram.h
+GENERATED_HEADERS=ldgram.h
-LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgramtb.h
+LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h
BFDSOURCES=../../bfd/common/*.c
@@ -84,12 +84,14 @@ all: Makefile $(PROCESSED_SCRIPTS) $(LD_PROG)
$(PROCESSED_SCRIPTS): mkscript $(SCRIPTS)
-ldgramtb.o ldgramtb.h:ldgram.y
- $(YACC) $<
- mv y.tab.c ldgramtb.c
- mv y.tab.h ldgramtb.h
- $(CC) -c $(CFLAGS) ldgramtb.c
- mv ldgramtb.o ldgram.o
+ldgram.c:ldgram.y
+ $(YACC) $(VPATH)/ldgram.y
+ mv y.tab.c ldgram.c
+ mv y.tab.h ldgram.h
+
+ldlex.c:ldlex.l
+ lex -t $(VPATH)/ldlex.l >ldlex.c
+
#$(BFDLIB): $(BFDSOURCES)
@@ -121,8 +123,10 @@ mkscript: mkscript.c
ldgld.o: $(PROCESSED_SCRIPTS) ldgld.c
-ldlex.c: ldlex.l ldgramtb.h
-ldlex.o: ldlex.c ldgramtb.h
+ldlex.c: ldlex.l ldgram.h
+ldlex.o: ldlex.c ldgram.h
+ldgram.o: ldgram.c
+ldgram.c:ldgram.y
ldgld68k.x :ldgld68k.script
ldgld68kUr.x :ldgld68kUr.script
@@ -153,9 +157,6 @@ stage3: force
- mv -f $(STAGESTUFF) stage3
- (cd stage3 ; ln -s $(LD_PROG) ld)
-comparison: force
- for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
-
de-stage1: force
- (cd stage1 ; mv -f * ..)
- rm ld
diff --git a/ld/ldgldm88kbcs.c b/ld/ldgldm88kbcs.c
index c89b38d..f3e9d96 100755
--- a/ld/ldgldm88kbcs.c
+++ b/ld/ldgldm88kbcs.c
@@ -49,7 +49,8 @@ extern bfd *output_bfd;
static void gldm88kbcs_before_parse()
{
-
+ extern char lprefix;
+ lprefix = '@';
}
diff --git a/ld/ldgldm88kbcs.script b/ld/ldgldm88kbcs.script
index ae7cb85..c4cb37e 100755
--- a/ld/ldgldm88kbcs.script
+++ b/ld/ldgldm88kbcs.script
@@ -1,36 +1,40 @@
+TARGET(m88kbcs)
OUTPUT_FORMAT(m88kbcs)
OUTPUT_ARCH(m88k)
+ENTRY(__start)
SEARCH_DIR(/lib)
SEARCH_DIR(/usr/lib)
SEARCH_DIR(/usr/local/lib)
-__DYNAMIC = 0;
SECTIONS
{
- .text 0x2020 BLOCK(0x2000):
- {
- CREATE_OBJECT_SYMBOLS
- *(.text)
- _etext = ALIGN( 0x2000);
+ .text 0x10000 + SIZEOF_HEADERS :
+ {
+ __.text.start = .;
+ __.init.start = .;
+ LONG(0xf400c001)
+ __.init.end = .;
+ *(.text)
+ __.tdesc_start = .;
+ *(.tdesc)
+ __.text_end = .;
+ __.initp.start = .;
+ __.initp.end =.;
+
+ _etext =.;
+ }
+ .data SIZEOF(.text) + ADDR(.text) + 0x400000:
+ {
+ *(.data)
+ _edata = .;
}
- .data ALIGN(0x2000) :
- {
- *(.data)
- ___DTOR_LIST__ = . ;
- LONG((___CTOR_LIST__ - .) / 4 -2)
- *(___DTOR_LIST__)
- LONG(0)
- ___CTOR_LIST__ = . ;
- LONG((_edata - .) / 4 -2)
- *(___CTOR_LIST__)
- LONG(0)
- _edata = .;
- }
.bss SIZEOF(.data) + ADDR(.data) :
- {
- *(.bss)
- [COMMON]
- _end = .;
+ {
+ *(.bss)
+ [COMMON]
+ _end = .;
+ ___end = .;
}
}
+