From fe4fa32c96bc16ffbdb13ed722f63b88721b5f8d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 23 Apr 2008 18:40:34 +0000 Subject: [PATCH] 2008-04-23 Mike Frysinger * Makefile.am (OBJ_FORMAT_CFILES): Add config/obj-fdpicelf.c. (OBJ_FORMAT_HFILES): Add config/obj-fdpicelf.h. (obj-fdpicelf.o): Define. * Makefile.in: Regenerate. * configure.tgt: Set bfd_gas to yes when fmt is fdpicelf. (bfin-*-*): Delete. (bfin-*-linux-uclibc): New; set fmt to fdpicelf and em to linux. (bfin-*-uclinux*): New; set fmt to elf and em to linux. * config/obj-fdpicelf.c: New. * config/obj-fdpicelf.h: Likewise. * config/tc-bfin.c (bfin_flags, bfin_pic_flag): Set default based on the OBJ_FDPIC_ELF define. (OPTION_NOPIC): Define. (md_longopts): Add mnopic and mno-fdpic. (md_parse_option): Handle OPTION_NOPIC. --- gas/ChangeLog | 18 ++++++++++++++++++ gas/Makefile.am | 4 ++++ gas/Makefile.in | 4 ++++ gas/config/obj-fdpicelf.c | 1 + gas/config/obj-fdpicelf.h | 2 ++ gas/config/tc-bfin.c | 20 +++++++++++++++++--- gas/configure.tgt | 7 +++++-- 7 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 gas/config/obj-fdpicelf.c create mode 100644 gas/config/obj-fdpicelf.h diff --git a/gas/ChangeLog b/gas/ChangeLog index 8f95163712b..6e5e5e4727d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,21 @@ +2008-04-23 Mike Frysinger + + * Makefile.am (OBJ_FORMAT_CFILES): Add config/obj-fdpicelf.c. + (OBJ_FORMAT_HFILES): Add config/obj-fdpicelf.h. + (obj-fdpicelf.o): Define. + * Makefile.in: Regenerate. + * configure.tgt: Set bfd_gas to yes when fmt is fdpicelf. + (bfin-*-*): Delete. + (bfin-*-linux-uclibc): New; set fmt to fdpicelf and em to linux. + (bfin-*-uclinux*): New; set fmt to elf and em to linux. + * config/obj-fdpicelf.c: New. + * config/obj-fdpicelf.h: Likewise. + * config/tc-bfin.c (bfin_flags, bfin_pic_flag): Set default based on + the OBJ_FDPIC_ELF define. + (OPTION_NOPIC): Define. + (md_longopts): Add mnopic and mno-fdpic. + (md_parse_option): Handle OPTION_NOPIC. + 2008-04-23 Paolo Bonzini * aclocal.m4: Regenerate. diff --git a/gas/Makefile.am b/gas/Makefile.am index cdae173d62a..617247f8c22 100644 --- a/gas/Makefile.am +++ b/gas/Makefile.am @@ -364,6 +364,7 @@ OBJ_FORMAT_CFILES = \ config/obj-ecoff.c \ config/obj-elf.c \ config/obj-evax.c \ + config/obj-fdpicelf.c \ config/obj-som.c OBJ_FORMAT_HFILES = \ @@ -372,6 +373,7 @@ OBJ_FORMAT_HFILES = \ config/obj-ecoff.h \ config/obj-elf.h \ config/obj-evax.h \ + config/obj-fdpicelf.h \ config/obj-som.h # Emulation header files in config @@ -586,6 +588,8 @@ obj-elf.o : $(srcdir)/config/obj-elf.c $(DEP_@target_cpu_type@_elf) $(COMPILE) -c $(srcdir)/config/obj-elf.c obj-evax.o : $(srcdir)/config/obj-evax.c $(COMPILE) -c $(srcdir)/config/obj-evax.c +obj-fdpicelf.o : $(srcdir)/config/obj-fdpicelf.c + $(COMPILE) -c $(srcdir)/config/obj-fdpicelf.c obj-multi.o : $(srcdir)/config/obj-multi.c $(COMPILE) -c $(srcdir)/config/obj-multi.c obj-som.o : $(srcdir)/config/obj-som.c diff --git a/gas/Makefile.in b/gas/Makefile.in index 77f2543bb7b..2d89648f3df 100644 --- a/gas/Makefile.in +++ b/gas/Makefile.in @@ -608,6 +608,7 @@ OBJ_FORMAT_CFILES = \ config/obj-ecoff.c \ config/obj-elf.c \ config/obj-evax.c \ + config/obj-fdpicelf.c \ config/obj-som.c OBJ_FORMAT_HFILES = \ @@ -616,6 +617,7 @@ OBJ_FORMAT_HFILES = \ config/obj-ecoff.h \ config/obj-elf.h \ config/obj-evax.h \ + config/obj-fdpicelf.h \ config/obj-som.h @@ -2586,6 +2588,8 @@ obj-elf.o : $(srcdir)/config/obj-elf.c $(DEP_@target_cpu_type@_elf) $(COMPILE) -c $(srcdir)/config/obj-elf.c obj-evax.o : $(srcdir)/config/obj-evax.c $(COMPILE) -c $(srcdir)/config/obj-evax.c +obj-fdpicelf.o : $(srcdir)/config/obj-fdpicelf.c + $(COMPILE) -c $(srcdir)/config/obj-fdpicelf.c obj-multi.o : $(srcdir)/config/obj-multi.c $(COMPILE) -c $(srcdir)/config/obj-multi.c obj-som.o : $(srcdir)/config/obj-som.c diff --git a/gas/config/obj-fdpicelf.c b/gas/config/obj-fdpicelf.c new file mode 100644 index 00000000000..a992b35f184 --- /dev/null +++ b/gas/config/obj-fdpicelf.c @@ -0,0 +1 @@ +#include "obj-elf.c" diff --git a/gas/config/obj-fdpicelf.h b/gas/config/obj-fdpicelf.h new file mode 100644 index 00000000000..9f1af5de17a --- /dev/null +++ b/gas/config/obj-fdpicelf.h @@ -0,0 +1,2 @@ +#define OBJ_FDPIC_ELF 1 +#include "obj-elf.h" diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c index 4652efa8116..3991622d0cd 100644 --- a/gas/config/tc-bfin.c +++ b/gas/config/tc-bfin.c @@ -50,8 +50,14 @@ FILE *errorf; /* Flags to set in the elf header */ #define DEFAULT_FLAGS 0 -static flagword bfin_flags = DEFAULT_FLAGS; -static const char *bfin_pic_flag = (const char *)0; +#ifdef OBJ_FDPIC_ELF +# define DEFAULT_FDPIC EF_BFIN_FDPIC +#else +# define DEFAULT_FDPIC 0 +#endif + +static flagword bfin_flags = DEFAULT_FLAGS | DEFAULT_FDPIC; +static const char *bfin_pic_flag = DEFAULT_FDPIC ? "-mfdpic" : (const char *)0; /* Registers list. */ struct bfin_reg_entry @@ -305,10 +311,13 @@ const char FLT_CHARS[] = "fFdDxX"; const char *md_shortopts = ""; #define OPTION_FDPIC (OPTION_MD_BASE) +#define OPTION_NOPIC (OPTION_MD_BASE + 1) struct option md_longopts[] = { - { "mfdpic", no_argument, NULL, OPTION_FDPIC }, + { "mfdpic", no_argument, NULL, OPTION_FDPIC }, + { "mnopic", no_argument, NULL, OPTION_NOPIC }, + { "mno-fdpic", no_argument, NULL, OPTION_NOPIC }, { NULL, no_argument, NULL, 0 }, }; @@ -327,6 +336,11 @@ md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED) bfin_flags |= EF_BFIN_FDPIC; bfin_pic_flag = "-mfdpic"; break; + + case OPTION_NOPIC: + bfin_flags &= ~(EF_BFIN_FDPIC); + bfin_pic_flag = 0; + break; } return 1; diff --git a/gas/configure.tgt b/gas/configure.tgt index 1d7e10d011a..a9c76eed1f5 100644 --- a/gas/configure.tgt +++ b/gas/configure.tgt @@ -125,8 +125,11 @@ case ${generic_target} in arm-*-riscix*) fmt=aout em=riscix ;; avr-*-*) fmt=elf bfd_gas=yes ;; - bfin-*-*) fmt=elf bfd_gas=yes ;; + + bfin-*-linux-uclibc) fmt=fdpicelf em=linux ;; + bfin-*-uclinux*) fmt=elf em=linux ;; bfin-*elf) fmt=elf ;; + cr16-*-elf*) fmt=elf ;; cris-*-linux-* | crisv32-*-linux-*) @@ -416,7 +419,7 @@ case ${cpu_type} in ;; esac case ${fmt} in - elf | ecoff | multi | som) + elf | ecoff | fdpicelf | multi | som) bfd_gas=yes ;; esac -- 2.30.2