2008-04-23 Mike Frysinger <vapier@gentoo.org>

* 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.
This commit is contained in:
Mike Frysinger 2008-04-23 18:40:34 +00:00
parent 5543870269
commit fe4fa32c96
7 changed files with 51 additions and 5 deletions

View File

@ -1,3 +1,21 @@
2008-04-23 Mike Frysinger <vapier@gentoo.org>
* 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 <bonzini@gnu.org>
* aclocal.m4: Regenerate.

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
#include "obj-elf.c"

View File

@ -0,0 +1,2 @@
#define OBJ_FDPIC_ELF 1
#include "obj-elf.h"

View File

@ -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;

View File

@ -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