Sun Nov 3 16:37:37 1991 Steve Chamberlain (steve at cygnus.com)
authorSteve Chamberlain <steve@cygnus>
Mon, 4 Nov 1991 00:45:25 +0000 (00:45 +0000)
committerSteve Chamberlain <steve@cygnus>
Mon, 4 Nov 1991 00:45:25 +0000 (00:45 +0000)
 i386 aout changes from Bob Kukura
* Makefile.in, config.h: added i386aout support
* configure.in: fixed /h-{myhost} typo
* ldgram.y: -MM now gives more boring map.
* ldlang.c: now does D_PAGED flag the right way.
* ldsym.c: -MM flags does the right thing.

ld/Makefile.in
ld/ldmain.c
ld/ldsym.c

index d1da0c0ed074e4ef534d7c540616f57ef6c2dfbd..bc0f755260b81f49266f7649fe7becf9f8da3f86 100644 (file)
@@ -1,5 +1,22 @@
-#
-# Makefile for ld version 2
+# Makefile for the GNU linker ld (version 2)
+# Copyright (C) 1989-1991 Free Software Foundation, Inc.
+
+# This file is part of GNU ld..
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
 #
 # $Id$
 #
@@ -9,9 +26,8 @@ srcdir = .
 destdir = /usr/local
 
 version=`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
-bindir = $(destdir)/H-$(host_alias)/T-$(target_alias)/bin
-libdir = $(destdir)/H-$(host_alias)/T-$(target_alias)/lib
-libsubdir = $(libdir)/gcc/$(target)/$(version)
+bindir = $(destdir)/bin
+gcclibdir = $(destdir)/lib/gcc/$(target_alias)/$(version)
 
 # Seach path to override the default search path for -lfoo libraries.
 # If LIB_PATH is empty, the ones in the script (if any) are left alone.
@@ -44,7 +60,7 @@ BISONFLAGS = -v
 
 SCRIPTS = ldgld68k.sc ldgld.sc \
        ldlnk960.sc ldlnk960r.sc ldgld960.sc \
-       ldm88k.sc ldglda29k.sc news.sc h8300hds.sc ebmon29k.sc
+       i386aout.sc ldm88k.sc ldglda29k.sc news.sc h8300hds.sc ebmon29k.sc
 
 #### target and host dependent Makefile fragments come in here.
 ###
@@ -122,17 +138,19 @@ 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 ldmain.o ldwarn.o ldwrite.o ldexp.o ldlnk960.o ldgld68k.o ldindr.o \
+OFILES= ldgram.o ldlex.o ldlang.o ldctor.o ldmain.o \
+       ldwarn.o ldwrite.o ldexp.o ldlnk960.o ldgld68k.o ldindr.o i386aout.o \
        ldm88k.o ldglda29k.o news.o h8300hds.o ebmon29k.o \
        ldgld.o ldgld960.o ldemul.o ldver.o ldmisc.o ldsym.o ldvanilla.o ldfile.o
 
-HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h ldsym.h ldlang.h ldexp.h \
+HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
+       ldsym.h ldctor.h ldlang.h ldexp.h \
        ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h
 
 MANSOURCES=ld.tex
 
-LDCSOURCES=ldlang.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c ldgld.c ldgld68k.c \
-       ldm88k.c ldgld29k.c \
+LDCSOURCES=ldlang.c ldctor.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
+       ldgld.c ldgld68k.c ldm88k.c ebmon29k.c \
        ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c ldvanilla.c
 
 GENERATED_SOURCES=ldgram.c ldlex.c ldgram.h 
@@ -166,6 +184,11 @@ news.c: $(srcdir)/ldtemplate
        sed -e s/"<ldtarget>"/news/g -e s/"<arch>"/m68k/g \
        -e s/"<target>"/news/g -e s/"<TARGET>"/NEWS/g <$(srcdir)/ldtemplate >$@
 
+i386aout.c: $(srcdir)/ldtemplate
+       sed -e s/"<ldtarget>"/i386aout/g -e s/"<arch>"/i386/g \
+       -e s/"<target>"/i386aout/g -e s/"<TARGET>"/I386AOUT/g <$(srcdir)/ldtemplate >$@
+
 ebmon29k.c: $(srcdir)/ldtemplate
        sed -e s/"<ldtarget>"/ebmon29k/g -e s/"<arch>"/a29k/g \
        -e s/"gld<target>"/ebmon29k/g -e s/"GLD<TARGET>"/EBMON29K/g \
@@ -184,6 +207,7 @@ ldm88k.c: $(srcdir)/ldtemplate
 # The .c files for these are generated from ldtemplete.
 ldgld.o: ./mkscript ldgld.x ldgld.xr ldgld.xu ldgld.xn ldgld.xN
 news.o: ./mkscript news.x news.xr news.xu news.xn news.xN
+i386aout.o: ./mkscript i386aout.x i386aout.xr i386aout.xu i386aout.xn i386aout.xN
 ebmon29k.o: ./mkscript ebmon29k.x ebmon29k.xr ebmon29k.xu \
        ebmon29k.xn ebmon29k.xN
 ldgld68k.o: ./mkscript ldgld68k.x ldgld68k.xr ldgld68k.xu \
@@ -299,6 +323,7 @@ ldm88kUr.x :ldm88kUr.sc
 ldm88kr.x:ldm88kr.sc
 ldm88k.x:ldm88k.sc
 news.x:news.sc
+i386aout.x:i386aout.sc
 h8300hds.x:h8300hds.sc
 h8300hds.o:h8300hds.c
 ldgld68k.x:ldgld68k.sc
@@ -372,9 +397,18 @@ release:
 objdump:objdump.c 
 
 install: $(LD_PROG)
-#      $(INSTALL_PROGRAM) ld.new $(libsubdir)/ld
-       cp $(LD_PROG) $(bindir)/ld.new
-       mv -f $(bindir)/ld.new $(bindir)/ld
+       $(INSTALL_PROGRAM) ld.new $(bindir)/ld
+# Something like the following might make sense for install, but doesn't work
+# - it is too fragile, depending on a gcc binary int the right place.
+# Perhaps using gcc/version.c might work?
+#      # If $(gcclibdir) exists, install ld there, and put a link to it
+#      # from $(bindir);  otherwise put ld in $(bindir).
+#      if ([ -x $(unsubdir)/../gcc$(subdir)/gcc -a -d $(gcclibdir) ]); then \
+#          $(INSTALL_PROGRAM) ld.new $(gcclibdir)/ld; \
+#          cd $(bindir); rm -f ld; ln -s $(gcclibdir)/ld ld; \
+#      else \
+#          $(INSTALL_PROGRAM) ld.new $(bindir)/ld;  \
+#      fi
 
 #-----------------------------------------------------------------------------
 #              'STANDARD' GNU/960 TARGETS BELOW THIS POINT
index 781f8dfc045eefeafa9d53b8cfa7e95274475f24..71ca4cf119b55030964d28db319881941d241130 100644 (file)
@@ -1,10 +1,11 @@
 /* Copyright (C) 1991 Free Software Foundation, Inc.
+   Written by Steve Chamberlain steve@cygnus.com
    
 This file is part of GLD, the Gnu Linker.
 
 GLD is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
 GLD is distributed in the hope that it will be useful,
@@ -17,8 +18,6 @@ along with GLD; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* 
- *  Written by Steve Chamberlain steve@cygnus.com
- *
  * $Id$ 
  */
 
@@ -164,7 +163,8 @@ main (argc, argv)
   multiple_def_count = 0;
   commons_pending = 0;
 
-  config.magic_demand_paged = true ;
+  config.magic_demand_paged = true;
+  config.text_read_only = true;
   config.make_executable = true;
   if (emulation == (char *)NULL) {
     emulation= DEFAULT_EMULATION;
@@ -204,16 +204,10 @@ main (argc, argv)
       info("%P%F: text marked read only, but no text section present");
     }
     found->flags |= SEC_READONLY;
-    output_bfd->flags |= WP_TEXT;
   }
-  else {
-    output_bfd->flags |= WP_TEXT;
-  }
-    
 
   if (config.relocateable_output) {
-    output_bfd->flags &=  ~( D_PAGED);
-    output_bfd->flags |= EXEC_P;
+    output_bfd->flags &= ~EXEC_P;
     ldwrite();
     bfd_close(output_bfd);
   }
@@ -508,6 +502,7 @@ struct lang_input_statement_struct *entry;
     {
       ldfile_open_file (entry);
 
+
 #ifdef GNU960
       if (gnu960_check_format(entry->the_bfd, bfd_object))
 #else
@@ -518,6 +513,11 @@ struct lang_input_statement_struct *entry;
 
 
          Q_read_entry_symbols (entry->the_bfd, entry);
+
+         /* look through the sections in the file and see if any of them
+            are constructors */
+         ldlang_check_for_constructors (entry);
+
          Q_enter_file_symbols (entry);
        }
 #ifdef GNU960
index 81a1a8c0fcd7b6b750e990537f9918a522561afc..d2914a9b43585129768f06306de90201c9c922cd 100644 (file)
@@ -219,7 +219,7 @@ lang_input_statement_type *f;
   else 
       {
        asection *s;
-       if (true || option_longmap) {
+       if (option_longmap) {
          for (s = f->the_bfd->sections;
               s != (asection *)NULL;
               s = s->next) {