diff options
author | Per Bothner <per@bothner.com> | 1991-10-11 23:47:05 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1991-10-11 23:47:05 +0000 |
commit | b7e24eef35ad6cfad5ebe645144d6dd28c0ce10a (patch) | |
tree | ad052dc7d604224a4b4b664a207874e1a0af855d /ld | |
parent | 6b58372076941752b0333890dbf0d2096ce64f97 (diff) | |
download | gdb-b7e24eef35ad6cfad5ebe645144d6dd28c0ce10a.zip gdb-b7e24eef35ad6cfad5ebe645144d6dd28c0ce10a.tar.gz gdb-b7e24eef35ad6cfad5ebe645144d6dd28c0ce10a.tar.bz2 |
* news.sc: Add alignment for data segment.
* ldtemplate: Add (yet another) script to get for -n or -N
options. (These need different alignment than ZMAGIC files.)
* Makefile.in: Add stuff for new foo.xn scripts.
These are generated by replacing "ALIGN(0x...00)" by ".".
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rw-r--r-- | ld/Makefile.in | 28 | ||||
-rwxr-xr-x | ld/ldtemplate | 6 | ||||
-rwxr-xr-x | ld/news.sc | 4 |
4 files changed, 35 insertions, 11 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 9887912..a7761a0 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +Fri Oct 11 16:42:22 1991 Per Bothner (bothner at cygnus.com) + + * news.sc: Add alignment for data segment. + * ldtemplate: Add (yet another) script to get for -n or -N + options. (These need different alignment than ZMAGIC files.) + * Makefile.in: Add stuff for new foo.xn scripts. + These are generated by replacing "ALIGN(0x...00)" by ".". + Fri Oct 11 15:43:04 1991 Roland H. Pesch (pesch at cygnus.com) * Makefile.in: new targets ld.ms, ld-index.ms diff --git a/ld/Makefile.in b/ld/Makefile.in index d52b73c..71523b1 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -52,7 +52,7 @@ SCRIPTS = ldgld68k.sc ldgld.sc \ CFLAGS = $(INCLUDES) $(DEBUG) $(HDEFINES) $(TDEFINES) $(CDEFINES) LINTFLAGS = $(INCLUDES) $(EXTRA_DEF) -.SUFFIXES: .y .x .xr .xu .sc .scu .scr $(SUFFIXES) +.SUFFIXES: .y .x .xr .xu .xn .sc .scu .scr .scn $(SUFFIXES) # go directly to ld.new in case this ld isn't capable of # linking native object on this host. It can be renamed on @@ -63,6 +63,8 @@ LD_PROG = ld.new # sed is used to transform this script into two variant forms: # A .scr script is for linking without relocation (-r flag). # A .scu script is like .scr, but *do* create constructors. +# A .scu script is for linking to non-demand-paged output (-N or -n). +# The diference is that segments should (need) not be page aligned. # A sed pattern to translate .sc to .scu: SED_MAKE_RELOC_WITH_CONSTRUCTORS=\ @@ -73,13 +75,19 @@ SED_MAKE_RELOC_WITH_CONSTRUCTORS=\ -e "/data/s/[.]data .*:/.data :/" # A sed pattern to translate .scu to .scr: SED_REMOVE_CONSTRUCTORS= -e /CONSTRUCTORS/d +# A sed pattern to translate .sc to .scn: +# We assume that any reasonable page size ends with 00 +# (Some things are aligned on 8-byte boundaries; ignore those.) +SED_DONT_ALIGN= -e '/ALIGN/s/ALIGN( *0x[0-9a-fA-F]*00 *)/./' .sc.scu: sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) $< >$*.scu +.sc.scn: + sed $(SED_DONT_ALIGN) $< >$*.scn .scu.scr: sed $(SED_REMOVE_CONSTRUCTORS) < $< >$*.scr -# Each .sc .scr or .scu script is filtered by mkscript +# Each .sc .scr .scu or .scn script is filtered by mkscript # into a string literal that can be included in a .c program. .sc.x: if [ "x"$(LIB_PATH) = "x" ]; then ./mkscript < $< >$*.x ; \ @@ -92,11 +100,15 @@ SED_REMOVE_CONSTRUCTORS= -e /CONSTRUCTORS/d ./mkscript < $< >$*.xu .scr.xr: ./mkscript < $< >$*.xr +.scn.xn: + ./mkscript < $< >$*.xn .sc.xu: sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) < $< | ./mkscript >$*.xu .sc.xr: sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) $(SED_REMOVE_CONSTRUCTORS) \ < $< | ./mkscript >$*.xr +.sc.xn: + sed $(SED_DONT_ALIGN) < $< | ./mkscript >$*.xn # for self hosting BFDLIB=$(unsubdir)/../bfd$(subdir)/libbfd.a @@ -162,12 +174,12 @@ ldm88k.c: $(srcdir)/ldtemplate -e s/"<target>"/m88kbcs/g -e s/"<TARGET>"/M88KBCS/g <$< >$@ # The .c files for these are generated from ldtemplete. -ldgld.o: ./mkscript ldgld.x ldgld.xr ldgld.xu -news.o: ./mkscript news.x news.xr news.xu -ebmon29k.o: ./mkscript ebmon29k.x ebmon29k.xr ebmon29k.xu -ldgld68k.o: ./mkscript ldgld68k.x ldgld68k.xr ldgld68k.xu -ldglda29k.o: ./mkscript ldglda29k.x ldglda29k.xr ldglda29k.xu -ldm88k.o: ./mkscript ldm88k.x ldm88k.xr ldm88k.xu +ldgld.o: ./mkscript ldgld.x ldgld.xr ldgld.xu ldgld.xn +news.o: ./mkscript news.x news.xr news.xu news.xn +ebmon29k.o: ./mkscript ebmon29k.x ebmon29k.xr ebmon29k.xu ebmon29k.xn +ldgld68k.o: ./mkscript ldgld68k.x ldgld68k.xr ldgld68k.xu ldgld68k.xn +ldglda29k.o: ./mkscript ldglda29k.x ldglda29k.xr ldglda29k.xu ldglda29k.xn +ldm88k.o: ./mkscript ldm88k.x ldm88k.xr ldm88k.xu ldm88k.xn # The .c files for these are (for now) specially written (not ldtemplete). ldgld960.o: ./mkscript ldgld960.x diff --git a/ld/ldtemplate b/ld/ldtemplate index dc91283..54e397e 100755 --- a/ld/ldtemplate +++ b/ld/ldtemplate @@ -126,6 +126,9 @@ static char *gld<target>_script_option_Ur = static char *gld<target>_script_option_r = #include "<ldtarget>.xr" ; +static char *gld<target>_script_option_n = /* Used with -n and -N flags. */ +#include "<ldtarget>.xn" +; static char *gld<target>_get_script() { @@ -137,7 +140,8 @@ static char *gld<target>_get_script() if (config.relocateable_output == true) { return gld<target>_script_option_r; } - + if (config.magic_demand_paged == false) + return gld<target>_script_option_n; return gld<target>_script; } struct ld_emulation_xfer_struct ld_gld<target>_emulation = @@ -11,9 +11,9 @@ SECTIONS { CREATE_OBJECT_SYMBOLS *(.text) - _etext = .; + _etext = ALIGN(0x1000); } - .data . : + .data ALIGN(0x1000) : { *(.data) CONSTRUCTORS; |