Add support for Phoenix-RTOS on ARM.

Message ID 1463044658-19231-1-git-send-email-jakub.sejdak@phoesys.com
State New, archived
Headers

Commit Message

Jakub Sejdak May 12, 2016, 9:17 a.m. UTC
  From: Kuba Sejdak <jakub.sejdak@phoesys.com>

---
 bfd/config.bfd                  |  4 ++++
 gas/configure.tgt               |  1 +
 ld/Makefile.am                  |  5 +++++
 ld/configure.tgt                |  1 +
 ld/emulparams/armelf_phoenix.sh | 24 ++++++++++++++++++++++++
 5 files changed, 35 insertions(+)
 create mode 100644 ld/emulparams/armelf_phoenix.sh
  

Comments

Jakub Sejdak May 12, 2016, 9:21 a.m. UTC | #1
Please regenerate configure files and import config.sub from GNU
config, as this patch depends on it.
I didn't write a changelog entry, because I don't know who is allowed
to do it: patch sender or global maintainters.

2016-05-12 11:17 GMT+02:00 Jakub Sejdak <jakub.sejdak@phoesys.com>:
> From: Kuba Sejdak <jakub.sejdak@phoesys.com>
>
> ---
>  bfd/config.bfd                  |  4 ++++
>  gas/configure.tgt               |  1 +
>  ld/Makefile.am                  |  5 +++++
>  ld/configure.tgt                |  1 +
>  ld/emulparams/armelf_phoenix.sh | 24 ++++++++++++++++++++++++
>  5 files changed, 35 insertions(+)
>  create mode 100644 ld/emulparams/armelf_phoenix.sh
>
> diff --git a/bfd/config.bfd b/bfd/config.bfd
> index 7c4eece..4e53304 100644
> --- a/bfd/config.bfd
> +++ b/bfd/config.bfd
> @@ -349,6 +349,10 @@ case "${targ}" in
>      targ_selvecs=arm_coff_be_vec
>      targ_underscore=yes
>      ;;
> +  arm-*-phoenix*)
> +    targ_defvec=arm_elf32_le_vec
> +    targ_selvecs=arm_elf32_be_vec
> +    ;;
>    arm-*-rtems*)
>      targ_defvec=arm_elf32_le_vec
>      targ_selvecs=arm_elf32_be_vec
> diff --git a/gas/configure.tgt b/gas/configure.tgt
> index 75470e4..4e0d4aa 100644
> --- a/gas/configure.tgt
> +++ b/gas/configure.tgt
> @@ -135,6 +135,7 @@ case ${generic_target} in
>
>    arm-*-aout)                          fmt=aout ;;
>    arm-*-coff)                          fmt=coff ;;
> +  arm-*-phoenix*)                      fmt=elf ;;
>    arm-*-rtems*)                                fmt=elf ;;
>    arm-*-elf)                           fmt=elf ;;
>    arm-*-eabi*)                         fmt=elf em=armeabi ;;
> diff --git a/ld/Makefile.am b/ld/Makefile.am
> index bf50e70..9d740d4 100644
> --- a/ld/Makefile.am
> +++ b/ld/Makefile.am
> @@ -179,6 +179,7 @@ ALL_EMULATION_SOURCES = \
>         earmelf_linux_eabi.c \
>         earmelf_nacl.c \
>         earmelf_nbsd.c \
> +       earmelf_phoenix.c \
>         earmelf_vxworks.c \
>         earmelfb.c \
>         earmelfb_fbsd.c \
> @@ -777,6 +778,10 @@ earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \
>    $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
>    $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
>
> +earmelf_phoenix.c: $(srcdir)/emulparams/armelf_phoenix.sh \
> +  $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
> +  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
> +
>  earmelf_vxworks.c: $(srcdir)/emulparams/armelf_vxworks.sh \
>    $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/armelf.sh \
>    $(ELF_DEPS) $(srcdir)/emultempl/vxworks.em \
> diff --git a/ld/configure.tgt b/ld/configure.tgt
> index 1f6db42..88c97cb 100644
> --- a/ld/configure.tgt
> +++ b/ld/configure.tgt
> @@ -103,6 +103,7 @@ arm-*-netbsd*)              targ_emul=armnbsd;
>                         targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd"  ;;
>  arm-*-nto*)            targ_emul=armnto ;;
>  arm-*-openbsd*)                targ_emul=armnbsd ;;
> +arm-*-phoenix*)                targ_emul=armelf ;;
>  arm-*-rtems*)          targ_emul=armelf ;;
>  armeb-*-elf | armeb-*-eabi*)
>                         targ_emul=armelfb ;;
> diff --git a/ld/emulparams/armelf_phoenix.sh b/ld/emulparams/armelf_phoenix.sh
> new file mode 100644
> index 0000000..d78edaf
> --- /dev/null
> +++ b/ld/emulparams/armelf_phoenix.sh
> @@ -0,0 +1,24 @@
> +ARCH=arm
> +SCRIPT_NAME=elf
> +OUTPUT_FORMAT="elf32-littlearm"
> +BIG_OUTPUT_FORMAT="elf32-bigarm"
> +LITTLE_OUTPUT_FORMAT="elf32-littlearm"
> +MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
> +COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
> +TEMPLATE_NAME=elf32
> +EXTRA_EM_FILE=armelf
> +GENERATE_SHLIB_SCRIPT=yes
> +GENERATE_PIE_SCRIPT=yes
> +
> +DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
> +OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)'
> +OTHER_BSS_SYMBOLS='__bss_start__ = .;'
> +OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
> +OTHER_END_SYMBOLS='__end__ = . ;'
> +OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
> +
> +TEXT_START_ADDR=0x00001000
> +TARGET2_TYPE=got-rel
> +
> +# ARM does not support .s* sections.
> +NO_SMALL_DATA=yes
> --
> 2.7.4
>
  
Yao Qi May 12, 2016, 1:33 p.m. UTC | #2
Jakub Sejdak <jakub.sejdak@phoesys.com> writes:

> Please regenerate configure files and import config.sub from GNU
> config, as this patch depends on it.

You can do it by yourself.  Import config.sub and config.guess to gcc,
and post the patch to gcc-patches mail list.  GCC maintainers can pick
it up, then you can sync the patch to binutils.

> I didn't write a changelog entry, because I don't know who is allowed
> to do it: patch sender or global maintainters.

You can write the changelog entry.
  
Jakub Sejdak May 19, 2016, 7:29 a.m. UTC | #3
config.sub and config.guess are already in newest version in GCC's
trunk. Will someone import them?
Having it done, can I to push this patch (with changelog included) to upstream?

2016-05-12 15:33 GMT+02:00 Yao Qi <qiyaoltc@gmail.com>:
> Jakub Sejdak <jakub.sejdak@phoesys.com> writes:
>
>> Please regenerate configure files and import config.sub from GNU
>> config, as this patch depends on it.
>
> You can do it by yourself.  Import config.sub and config.guess to gcc,
> and post the patch to gcc-patches mail list.  GCC maintainers can pick
> it up, then you can sync the patch to binutils.
>
>> I didn't write a changelog entry, because I don't know who is allowed
>> to do it: patch sender or global maintainters.
>
> You can write the changelog entry.
>
> --
> Yao (齐尧)
  
Yao Qi May 19, 2016, 1:16 p.m. UTC | #4
Jakub Sejdak <jakub.sejdak@phoesys.com> writes:

> config.sub and config.guess are already in newest version in GCC's
> trunk. Will someone import them?

You can post a patch to sync config.sub and config.guess in
binutils-gdb.  binutils maintainers can review, approve and commit the
patch for you if you don't have the write access to the git repo.

> Having it done, can I to push this patch (with changelog included) to upstream?

No, this patch still needs proper review.  I am not the right person to
review and approve this patch.
  
Nick Clifton May 23, 2016, 12:56 p.m. UTC | #5
Hi Jakub,

  Thanks for submitting this patch.  I have now applied it to the 
  sources along with these changelog entries:

bfd/ChangeLog
2016-05-23  Kuba Sejdak  <jakub.sejdak@phoesys.com>

	* config.bfd: Add entry for arm-phoenix.

gas/ChangeLog
2016-05-23  Kuba Sejdak  <jakub.sejdak@phoesys.com>

	* configuse.tgt: Add entry for arm-phoenix.

ld/ChangeLog
2016-05-23  Kuba Sejdak  <jakub.sejdak@phoesys.com>

	* Makefile.am: Add earmelf_phoenix.c.
	* Makefile.in: Regenerate.
	* configure.tgt: Add entry for arm-phoenix.
	* emulparams/armelf_phoenix.sh: New file.

  Note - in the future it helps if you can provide the changelog
  entries yourself.

Cheers
  Nick
  
Jakub Sejdak May 23, 2016, 1:55 p.m. UTC | #6
Hi Nick,

Thank you accepting and applying patch. I will remember about
changelog next time.

By the way, is there any schedule for next binutils snapshot? Our
clients are depending on this patch and it would be easier to point to
snapshot rather than git repository.

Thanks,
Jakub Sejdak

2016-05-23 14:56 GMT+02:00 Nick Clifton <nickc@redhat.com>:
> Hi Jakub,
>
>   Thanks for submitting this patch.  I have now applied it to the
>   sources along with these changelog entries:
>
> bfd/ChangeLog
> 2016-05-23  Kuba Sejdak  <jakub.sejdak@phoesys.com>
>
>         * config.bfd: Add entry for arm-phoenix.
>
> gas/ChangeLog
> 2016-05-23  Kuba Sejdak  <jakub.sejdak@phoesys.com>
>
>         * configuse.tgt: Add entry for arm-phoenix.
>
> ld/ChangeLog
> 2016-05-23  Kuba Sejdak  <jakub.sejdak@phoesys.com>
>
>         * Makefile.am: Add earmelf_phoenix.c.
>         * Makefile.in: Regenerate.
>         * configure.tgt: Add entry for arm-phoenix.
>         * emulparams/armelf_phoenix.sh: New file.
>
>   Note - in the future it helps if you can provide the changelog
>   entries yourself.
>
> Cheers
>   Nick
  
Nick Clifton May 24, 2016, 9:43 a.m. UTC | #7
Hi Jakub,

> By the way, is there any schedule for next binutils snapshot?

We do not have a well defined schedule for binutils releases. :-(

Ideally we would like to make two releases a year, but it does
depend upon the time and resources available, especially to our
release manager - Tristan Gringold.  It is my hope however that
we will be making another release this summer.


> Our clients are depending on this patch and it would be easier to point to
> snapshot rather than git repository.

There are weekly snapshots available from here:

  ftp://sourceware.org/pub/binutils/snapshots/

Cheers
  Nick
  

Patch

diff --git a/bfd/config.bfd b/bfd/config.bfd
index 7c4eece..4e53304 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -349,6 +349,10 @@  case "${targ}" in
     targ_selvecs=arm_coff_be_vec
     targ_underscore=yes
     ;;
+  arm-*-phoenix*)
+    targ_defvec=arm_elf32_le_vec
+    targ_selvecs=arm_elf32_be_vec
+    ;;
   arm-*-rtems*)
     targ_defvec=arm_elf32_le_vec
     targ_selvecs=arm_elf32_be_vec
diff --git a/gas/configure.tgt b/gas/configure.tgt
index 75470e4..4e0d4aa 100644
--- a/gas/configure.tgt
+++ b/gas/configure.tgt
@@ -135,6 +135,7 @@  case ${generic_target} in
 
   arm-*-aout)				fmt=aout ;;
   arm-*-coff)				fmt=coff ;;
+  arm-*-phoenix*)			fmt=elf ;;
   arm-*-rtems*)				fmt=elf ;;
   arm-*-elf)				fmt=elf ;;
   arm-*-eabi*)				fmt=elf em=armeabi ;;
diff --git a/ld/Makefile.am b/ld/Makefile.am
index bf50e70..9d740d4 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -179,6 +179,7 @@  ALL_EMULATION_SOURCES = \
 	earmelf_linux_eabi.c \
 	earmelf_nacl.c \
 	earmelf_nbsd.c \
+	earmelf_phoenix.c \
 	earmelf_vxworks.c \
 	earmelfb.c \
 	earmelfb_fbsd.c \
@@ -777,6 +778,10 @@  earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \
   $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 
+earmelf_phoenix.c: $(srcdir)/emulparams/armelf_phoenix.sh \
+  $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
 earmelf_vxworks.c: $(srcdir)/emulparams/armelf_vxworks.sh \
   $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/armelf.sh \
   $(ELF_DEPS) $(srcdir)/emultempl/vxworks.em \
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 1f6db42..88c97cb 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -103,6 +103,7 @@  arm-*-netbsd*)		targ_emul=armnbsd;
 			targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd"  ;;
 arm-*-nto*)		targ_emul=armnto ;;
 arm-*-openbsd*)		targ_emul=armnbsd ;;
+arm-*-phoenix*)		targ_emul=armelf ;;
 arm-*-rtems*)		targ_emul=armelf ;;
 armeb-*-elf | armeb-*-eabi*)
 			targ_emul=armelfb ;;
diff --git a/ld/emulparams/armelf_phoenix.sh b/ld/emulparams/armelf_phoenix.sh
new file mode 100644
index 0000000..d78edaf
--- /dev/null
+++ b/ld/emulparams/armelf_phoenix.sh
@@ -0,0 +1,24 @@ 
+ARCH=arm
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-littlearm"
+BIG_OUTPUT_FORMAT="elf32-bigarm"
+LITTLE_OUTPUT_FORMAT="elf32-littlearm"
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=armelf
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+
+DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
+OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)'
+OTHER_BSS_SYMBOLS='__bss_start__ = .;'
+OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
+OTHER_END_SYMBOLS='__end__ = . ;'
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
+
+TEXT_START_ADDR=0x00001000
+TARGET2_TYPE=got-rel
+
+# ARM does not support .s* sections.
+NO_SMALL_DATA=yes