This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Tuesday 22 April 2008, Nick Clifton wrote: > > what i'd like to do is promote FDPIC ELF as an object format so that we > > can do the default target binding based on tuple and in the configure > > scripts rather than having this logic in the source code. the annoying > > part is that the obj-fdpicelf files merely define one or two things and > > then include the normal obj-elf files. i'm attaching a working patch > > (that is both outdated wrt CVS head and lacking ChangeLogs/etc...) to > > show what i mean. if this is the way to go, i'll clean it up and submit > > it for commit. > > It may seem rather clunky, but I think that this is the way to go. So > please do submit a tidied up patch. here you go. ok to commit ? -mike 2008-04-22 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.
Attachment:
signature.asc
Description: This is a digitally signed message part.
Index: Makefile.am =================================================================== RCS file: /cvs/src/src/gas/Makefile.am,v retrieving revision 1.156 diff -u -p -r1.156 Makefile.am --- Makefile.am 13 Mar 2008 02:05:20 -0000 1.156 +++ Makefile.am 22 Apr 2008 20:47:23 -0000 @@ -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 $ $(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 Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gas/Makefile.in,v retrieving revision 1.173 diff -u -p -r1.173 Makefile.in --- Makefile.in 17 Mar 2008 22:17:29 -0000 1.173 +++ Makefile.in 22 Apr 2008 20:47:27 -0000 @@ -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 $ $(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 Index: configure.tgt =================================================================== RCS file: /cvs/src/src/gas/configure.tgt,v retrieving revision 1.39 diff -u -p -r1.39 configure.tgt --- configure.tgt 1 Feb 2008 17:58:47 -0000 1.39 +++ configure.tgt 22 Apr 2008 20:47:27 -0000 @@ -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 Index: config/obj-fdpicelf.c =================================================================== RCS file: config/obj-fdpicelf.c diff -N config/obj-fdpicelf.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ config/obj-fdpicelf.c 22 Apr 2008 20:47:27 -0000 @@ -0,0 +1 @@ +#include "obj-elf.c" Index: config/obj-fdpicelf.h =================================================================== RCS file: config/obj-fdpicelf.h diff -N config/obj-fdpicelf.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ config/obj-fdpicelf.h 22 Apr 2008 20:47:27 -0000 @@ -0,0 +1,2 @@ +#define OBJ_FDPIC_ELF 1 +#include "obj-elf.h" Index: config/tc-bfin.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-bfin.c,v retrieving revision 1.15 diff -u -p -r1.15 tc-bfin.c --- config/tc-bfin.c 26 Mar 2008 16:33:33 -0000 1.15 +++ config/tc-bfin.c 22 Apr 2008 20:47:28 -0000 @@ -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, 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;
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |