diff options
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rw-r--r-- | ld/mac-ld.r | 28 | ||||
-rw-r--r-- | ld/mpw-config.in | 8 | ||||
-rw-r--r-- | ld/mpw-eppcmac.c (renamed from ld/mpw-eppcmacos.c) | 19 |
4 files changed, 59 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 10912da..89d3e1d 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +Tue Dec 12 13:55:41 1995 Stan Shebs <shebs@andros.cygnus.com> + + * mpw-config.in: Recognize mips-*-* as equivalent to + mips-idt-ecoff. + * mpw-eppcmacos.c: Rename to shorter mpw-eppcmac.c. + * mpw-ld.r: Add version resources. + (cfrg): Use symbolic instead of literal name for executable. + Mon Dec 11 15:13:41 1995 Kim Knuttila <krk@cygnus.com> * scripttempl/ppcpe.sc (FINI): Moved the .reloc section. diff --git a/ld/mac-ld.r b/ld/mac-ld.r index 8500a80..b316fc5 100644 --- a/ld/mac-ld.r +++ b/ld/mac-ld.r @@ -1,3 +1,29 @@ +/* Resources for GNU LD. */ + +#include "SysTypes.r" + +/* Version resources. */ + +resource 'vers' (1) { + 0, + 0, + 0, + 0, + verUs, + VERSION_STRING, + VERSION_STRING " (C) 1986-95 FSF, Inc." +}; + +resource 'vers' (2, purgeable) { + 0, + 0, + 0, + 0, + verUs, + VERSION_STRING, + "GLD " VERSION_STRING " for MPW" +}; + #ifdef WANT_CFRG #include "CodeFragmentTypes.r" @@ -9,7 +35,7 @@ resource 'cfrg' (0) { kNoVersionNum, kNoVersionNum, 0, 0, kIsApp, kOnDiskFlat, kZeroOffset, kWholeFork, - "ld" + PROG_NAME } }; diff --git a/ld/mpw-config.in b/ld/mpw-config.in index 45fc41f..ff45f96 100644 --- a/ld/mpw-config.in +++ b/ld/mpw-config.in @@ -4,18 +4,22 @@ If "{target_canonical}" =~ /m68k-apple-macos/ Set emulname m68kcoff forward-include "{srcdir}"mpw-em68kcoff.c em68kcoff.c Set emulation_ofiles "{o}"em68kcoff.c.o + Else If "{target_canonical}" =~ /powerpc-apple-macos/ Set emulname ppcmacos - forward-include "{srcdir}"mpw-eppcmacos.c eppcmacos.c + forward-include "{srcdir}"mpw-eppcmac.c eppcmacos.c Set emulation_ofiles "{o}"eppcmacos.c.o + Else If "{target_canonical}" =~ /i386-unknown-go32/ Set emulname i386go32 forward-include "{srcdir}"mpw-ei386go32.c ei386go32.c Set emulation_ofiles "{o}"ei386go32.c.o -Else If "{target_canonical}" =~ /mips-idt-ecoff/ + +Else If "{target_canonical}" =~ /mips-\Option-x-\Option-x/ Set emulname mipsidt forward-include "{srcdir}"mpw-emipsidt.c emipsidt.c Set emulation_ofiles "{o}"emipsidt.c.o + Else If "{target_canonical}" =~ /sh-hitachi-hms/ Set emulname sh forward-include "{srcdir}"mpw-esh.c esh.c diff --git a/ld/mpw-eppcmacos.c b/ld/mpw-eppcmac.c index 0febbe3..b25b371 100644 --- a/ld/mpw-eppcmacos.c +++ b/ld/mpw-eppcmac.c @@ -72,6 +72,9 @@ static unsigned short modtype = ('1' << 8) | 'L'; permitted). */ static int textro; +/* Whether to implement Unix like linker semantics. */ +static int unix_ld; + /* Structure used to hold import file list. */ struct filelist @@ -134,6 +137,7 @@ gldppcmacos_parse_args (argc, argv) #define OPTION_PD (OPTION_NOSTRCMPCT + 1) #define OPTION_PT (OPTION_PD + 1) #define OPTION_STRCMPCT (OPTION_PT + 1) +#define OPTION_UNIX (OPTION_STRCMPCT + 1) static struct option longopts[] = { {"basis", no_argument, NULL, OPTION_IGNORE}, @@ -174,6 +178,7 @@ gldppcmacos_parse_args (argc, argv) {"bstrcmpct", no_argument, NULL, OPTION_STRCMPCT}, {"btextro", no_argument, &textro, 1}, {"static", no_argument, NULL, OPTION_NOAUTOIMP}, + {"unix", no_argument, NULL, OPTION_UNIX}, {NULL, no_argument, NULL, 0} }; @@ -381,6 +386,10 @@ gldppcmacos_parse_args (argc, argv) case OPTION_STRCMPCT: config.traditional_format = false; break; + + case OPTION_UNIX: + unix_ld = true; + break; } return 1; @@ -437,6 +446,7 @@ gldppcmacos_before_allocation () struct filelist *fl; struct export_symbol_list *el; char *libpath; + boolean export_defineds; asection *special_sections[6]; int i; @@ -487,13 +497,20 @@ gldppcmacos_before_allocation () } } + /* If we are emulating the Unix linker, we want to export all + defined symbols, unless an explicit -bE option was used. */ + export_defineds = false; + if (unix_ld && export_symbols == NULL) + export_defineds = true; + /* Let the XCOFF backend set up the .loader section. */ if (! bfd_xcoff_size_dynamic_sections (output_bfd, &link_info, libpath, entry_symbol, file_align, maxstack, maxdata, - gc ? true : false, + gc && ! unix_ld ? true : false, modtype, textro ? true : false, + export_defineds, special_sections)) einfo ("%P%F: failed to set dynamic section sizes: %E\n"); |