From: Ian Lance Taylor Date: Wed, 1 Nov 1995 16:46:19 +0000 (+0000) Subject: * emultempl/aix.em: Include ldgram.h. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2a80ec10a8f70f3dc4202c3e12c2feb5d769b6df;p=binutils-gdb.git * emultempl/aix.em: Include ldgram.h. (gld${EMULATION_NAME}_parse_args): Handle -pD and -pT, as used on AIX 4.1. * Makefile.in ($(EMULATION_OFILES)): Depend upon ldgram.h. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 0af2df3b1f9..12d41799d02 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +Wed Nov 1 11:41:56 1995 Ian Lance Taylor + + * emultempl/aix.em: Include ldgram.h. + (gld${EMULATION_NAME}_parse_args): Handle -pD and -pT, as used on + AIX 4.1. + * Makefile.in ($(EMULATION_OFILES)): Depend upon ldgram.h. + Tue Oct 31 18:22:24 1995 David Mosberger-Tang * configure.host (alpha-*-linux*): New host. diff --git a/ld/Makefile.in b/ld/Makefile.in index 74ad689061e..cdfce17686c 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -517,7 +517,7 @@ $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY) # The generated emulation files mostly have the same dependencies. $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \ ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \ - ldctor.h ldexp.h ldlang.h + ldctor.h ldexp.h ldlang.h ldgram.h # These targets are for the dejagnu testsuites. The file site.exp # contains global variables that all the testsuites will use. diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index 933f9cbd3e0..971eeedf1be 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -42,6 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldexp.h" #include "ldlang.h" #include "ldctor.h" +#include "ldgram.h" static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); static int gld${EMULATION_NAME}_parse_args PARAMS ((int, char **)); @@ -132,7 +133,9 @@ gld${EMULATION_NAME}_parse_args (argc, argv) #define OPTION_MODTYPE (OPTION_MAXSTACK + 1) #define OPTION_NOAUTOIMP (OPTION_MODTYPE + 1) #define OPTION_NOSTRCMPCT (OPTION_NOAUTOIMP + 1) -#define OPTION_STRCMPCT (OPTION_NOSTRCMPCT + 1) +#define OPTION_PD (OPTION_NOSTRCMPCT + 1) +#define OPTION_PT (OPTION_PD + 1) +#define OPTION_STRCMPCT (OPTION_PT + 1) static struct option longopts[] = { {"basis", no_argument, NULL, OPTION_IGNORE}, @@ -163,6 +166,8 @@ gld${EMULATION_NAME}_parse_args (argc, argv) {"bnostrcmpct", no_argument, NULL, OPTION_NOSTRCMPCT}, {"bnotextro", no_argument, &textro, 0}, {"bnro", no_argument, &textro, 0}, + {"bpD", required_argument, NULL, OPTION_PD}, + {"bpT", required_argument, NULL, OPTION_PT}, {"bro", no_argument, &textro, 1}, {"bS", required_argument, NULL, OPTION_MAXSTACK}, {"bso", no_argument, NULL, OPTION_AUTOIMP}, @@ -324,6 +329,51 @@ gld${EMULATION_NAME}_parse_args (argc, argv) config.traditional_format = true; break; + case OPTION_PD: + /* This sets the page that the .data section is supposed to + start on. The offset within the page should still be the + offset within the file, so we need to build an appropriate + expression. */ + val = strtoul (optarg, &end, 0); + if (*end != '\0') + einfo ("%P: warning: ignoring invalid -pD number %s\n", optarg); + else + { + etree_type *t; + + t = exp_binop ('+', + exp_intop (val), + exp_binop ('&', + exp_nameop (NAME, "."), + exp_intop (0xfff))); + t = exp_binop ('&', + exp_binop ('+', t, exp_intop (7)), + exp_intop (~ (bfd_vma) 7)); + lang_section_start (".data", t); + } + break; + + case OPTION_PT: + /* This set the page that the .text section is supposed to start + on. The offset within the page should still be the offset + within the file. */ + val = strtoul (optarg, &end, 0); + if (*end != '\0') + einfo ("%P: warning: ignoring invalid -pT number %s\n", optarg); + else + { + etree_type *t; + + t = exp_binop ('+', + exp_intop (val), + exp_nameop (SIZEOF_HEADERS, NULL)); + t = exp_binop ('&', + exp_binop ('+', t, exp_intop (7)), + exp_intop (~ (bfd_vma) 7)); + lang_section_start (".text", t); + } + break; + case OPTION_STRCMPCT: config.traditional_format = false; break;