diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-11-15 22:30:47 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-11-15 22:30:47 +0000 |
commit | 781303cee5db333c5635d22bc1f7a0a996b7e0d5 (patch) | |
tree | 6fd813d1143496f6284fa88ddfe1b5c95ca91923 | |
parent | c85f715a62b5282c19da485e133686f29675b801 (diff) | |
download | binutils-781303cee5db333c5635d22bc1f7a0a996b7e0d5.zip binutils-781303cee5db333c5635d22bc1f7a0a996b7e0d5.tar.gz binutils-781303cee5db333c5635d22bc1f7a0a996b7e0d5.tar.bz2 |
blackfin: add support for L1 code/data flags
Add new linker options for marking programs to load into L1 memory
at runtime. This needs new EF flag bits, so declare them.
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf32-bfin.c | 18 | ||||
-rw-r--r-- | binutils/ChangeLog | 4 | ||||
-rw-r--r-- | binutils/readelf.c | 15 | ||||
-rw-r--r-- | include/ChangeLog | 5 | ||||
-rw-r--r-- | include/elf/bfin.h | 3 | ||||
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rw-r--r-- | ld/Makefile.am | 7 | ||||
-rw-r--r-- | ld/Makefile.in | 7 | ||||
-rwxr-xr-x | ld/emulparams/bfin.sh | 1 | ||||
-rw-r--r-- | ld/emulparams/elf32bfinfd.sh | 1 |
11 files changed, 70 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 596c577..a67868e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2010-11-16 Jie Zhang <jie.zhang@analog.com> + + * elf32-bfin.c (elf32_bfin_code_in_l1): New variable. + (elf32_bfin_data_in_l1): New variable. + (elf32_bfin_final_write_processing): New. + (elf_backend_final_write_processing): Define. + 2010-11-15 Mike Frysinger <vapier@gentoo.org> PR binutils/12177 diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c index 38f31e4..56af244 100644 --- a/bfd/elf32-bfin.c +++ b/bfd/elf32-bfin.c @@ -1120,6 +1120,22 @@ bfin_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, return (reloc_howto_type *) NULL; } +/* Set by ld emulation if --code-in-l1. */ +bfd_boolean elf32_bfin_code_in_l1 = 0; + +/* Set by ld emulation if --data-in-l1. */ +bfd_boolean elf32_bfin_data_in_l1 = 0; + +static void +elf32_bfin_final_write_processing (bfd *abfd, + bfd_boolean linker ATTRIBUTE_UNUSED) +{ + if (elf32_bfin_code_in_l1) + elf_elfheader (abfd)->e_flags |= EF_BFIN_CODE_IN_L1; + if (elf32_bfin_data_in_l1) + elf_elfheader (abfd)->e_flags |= EF_BFIN_DATA_IN_L1; +} + /* Return TRUE if the name is a local label. bfin local labels begin with L$. */ static bfd_boolean @@ -5787,6 +5803,8 @@ struct bfd_elf_special_section const elf32_bfin_special_sections[] = elf32_bfin_set_private_flags #define bfd_elf32_bfd_print_private_bfd_data \ elf32_bfin_print_private_bfd_data +#define elf_backend_final_write_processing \ + elf32_bfin_final_write_processing #define elf_backend_reloc_type_class elf32_bfin_reloc_type_class #define elf_backend_can_gc_sections 1 #define elf_backend_special_sections elf32_bfin_special_sections diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 7f32615..0c431af 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2010-11-16 Jie Zhang <jie.zhang@analog.com> + + * readelf.c (get_machine_flags): Deal with Blackfin specific flags. + 2010-11-11 Mingming Sun <mingm.sun@gmail.com> * readelf.c (get_machine_flags): Add loongson-3a. diff --git a/binutils/readelf.c b/binutils/readelf.c index 22ca25c5..1682e0a 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -2238,6 +2238,21 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) decode_ARM_machine_flags (e_flags, buf); break; + case EM_BLACKFIN: + if (e_flags & EF_BFIN_PIC) + strcat (buf, ", PIC"); + + if (e_flags & EF_BFIN_FDPIC) + strcat (buf, ", FDPIC"); + + if (e_flags & EF_BFIN_CODE_IN_L1) + strcat (buf, ", code in L1"); + + if (e_flags & EF_BFIN_DATA_IN_L1) + strcat (buf, ", data in L1"); + + break; + case EM_CYGNUS_FRV: switch (e_flags & EF_FRV_CPU_MASK) { diff --git a/include/ChangeLog b/include/ChangeLog index fb1f432..56314cb 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2010-11-16 Jie Zhang <jie.zhang@analog.com> + + * elf/bfin.h (EF_BFIN_CODE_IN_L1): Define. + (EF_BFIN_DATA_IN_L1): Define. + 2010-11-04 Ian Lance Taylor <iant@google.com> * dwarf2.h (enum dwarf_source_language): Add DW_LANG_Go. diff --git a/include/elf/bfin.h b/include/elf/bfin.h index 851873f..8d92906 100644 --- a/include/elf/bfin.h +++ b/include/elf/bfin.h @@ -88,5 +88,8 @@ END_RELOC_NUMBERS (R_BFIN_max) #define EF_BFIN_PIC 0x00000001 /* -fpic */ #define EF_BFIN_FDPIC 0x00000002 /* -mfdpic */ +#define EF_BFIN_CODE_IN_L1 0x00000010 /* --code-in-l1 */ +#define EF_BFIN_DATA_IN_L1 0x00000020 /* --data-in-l1 */ + #define EF_BFIN_PIC_FLAGS (EF_BFIN_PIC | EF_BFIN_FDPIC) #endif /* _ELF_BFIN_H */ diff --git a/ld/ChangeLog b/ld/ChangeLog index 6af766e..7ece09f 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2010-11-16 Jie Zhang <jie.zhang@analog.com> + + * Makefile.am (eelf32bfinfd.c, eelf32bfin.c): Depend on bfin.em. + * Makefile.in: Regenerated. + * emulparams/bfin.sh (EXTRA_EM_FILE): Set. + * emulparams/elf32bfinfd.sh (EXTRA_EM_FILE): Likewise. + * emultempl/bfin.em: New. + 2010-11-16 Yasuaki Taniguchi <taniguchi.yasua@jp.fujitsu.com> * emultempl/pe.em (_list_options): Correct typo. diff --git a/ld/Makefile.am b/ld/Makefile.am index b4364be..d9e1bcc 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -791,11 +791,12 @@ edelta68.c: $(srcdir)/emulparams/delta68.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS} ${GENSCRIPTS} delta68 "$(tdir_delta68)" eelf32bfin.c: $(srcdir)/emulparams/bfin.sh \ - $(ELF_DEPS) \ + $(ELF_DEPS) $(srcdir)/emultempl/bfin.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bfin "$(tdir_elf32bfin)" bfin -eelf32bfinfd.c: $(srcdir)/emulparams/elf32bfinfd.sh $(srcdir)/emulparams/bfin.sh \ - $(ELF_DEPS) \ +eelf32bfinfd.c: $(srcdir)/emulparams/elf32bfinfd.sh \ + $(srcdir)/emulparams/bfin.sh \ + $(ELF_DEPS) $(srcdir)/emultempl/bfin.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bfinfd "$(tdir_elf32bfinfd)" elf32bfinfd eelf32_dlx.c: $(srcdir)/emulparams/elf32_dlx.sh \ diff --git a/ld/Makefile.in b/ld/Makefile.in index dac81b3..01511bc 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -2214,11 +2214,12 @@ edelta68.c: $(srcdir)/emulparams/delta68.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS} ${GENSCRIPTS} delta68 "$(tdir_delta68)" eelf32bfin.c: $(srcdir)/emulparams/bfin.sh \ - $(ELF_DEPS) \ + $(ELF_DEPS) $(srcdir)/emultempl/bfin.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bfin "$(tdir_elf32bfin)" bfin -eelf32bfinfd.c: $(srcdir)/emulparams/elf32bfinfd.sh $(srcdir)/emulparams/bfin.sh \ - $(ELF_DEPS) \ +eelf32bfinfd.c: $(srcdir)/emulparams/elf32bfinfd.sh \ + $(srcdir)/emulparams/bfin.sh \ + $(ELF_DEPS) $(srcdir)/emultempl/bfin.em \ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf32bfinfd "$(tdir_elf32bfinfd)" elf32bfinfd eelf32_dlx.c: $(srcdir)/emulparams/elf32_dlx.sh \ diff --git a/ld/emulparams/bfin.sh b/ld/emulparams/bfin.sh index 3de8921..6c0bb40 100755 --- a/ld/emulparams/bfin.sh +++ b/ld/emulparams/bfin.sh @@ -9,3 +9,4 @@ TEMPLATE_NAME=elf32 GENERATE_SHLIB_SCRIPT=yes EMBEDDED=yes USER_LABEL_PREFIX=_ +EXTRA_EM_FILE=bfin diff --git a/ld/emulparams/elf32bfinfd.sh b/ld/emulparams/elf32bfinfd.sh index 3e0420e..26f8f47 100644 --- a/ld/emulparams/elf32bfinfd.sh +++ b/ld/emulparams/elf32bfinfd.sh @@ -43,3 +43,4 @@ OTHER_SECTIONS=" *(.l1.text) } " +EXTRA_EM_FILE=bfin |