diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 596c57764e..a67868ed57 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2010-11-16 Jie Zhang + + * 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 PR binutils/12177 diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c index 38f31e4f5a..56af244f4c 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 7f32615adc..0c431af0f1 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2010-11-16 Jie Zhang + + * readelf.c (get_machine_flags): Deal with Blackfin specific flags. + 2010-11-11 Mingming Sun * readelf.c (get_machine_flags): Add loongson-3a. diff --git a/binutils/readelf.c b/binutils/readelf.c index 22ca25c558..1682e0a26c 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 fb1f432538..56314cbf35 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2010-11-16 Jie Zhang + + * elf/bfin.h (EF_BFIN_CODE_IN_L1): Define. + (EF_BFIN_DATA_IN_L1): Define. + 2010-11-04 Ian Lance Taylor * dwarf2.h (enum dwarf_source_language): Add DW_LANG_Go. diff --git a/include/elf/bfin.h b/include/elf/bfin.h index 851873f97c..8d92906aab 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 6af766e9c1..7ece09f93f 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2010-11-16 Jie Zhang + + * 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 * emultempl/pe.em (_list_options): Correct typo. diff --git a/ld/Makefile.am b/ld/Makefile.am index b4364be6f1..d9e1bcca24 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 dac81b3167..01511bcf6e 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 3de89218cc..6c0bb4090b 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 3e0420e793..26f8f4701d 100644 --- a/ld/emulparams/elf32bfinfd.sh +++ b/ld/emulparams/elf32bfinfd.sh @@ -43,3 +43,4 @@ OTHER_SECTIONS=" *(.l1.text) } " +EXTRA_EM_FILE=bfin