[PATCH, RX] Add target rx-*-linux
Oleg Endo
oleg.endo@t-online.de
Mon Jul 30 13:14:00 GMT 2018
Hi,
I've been using RX myself for a while and I'm wondering where this is
coming from or where this is going?
The biggest RX MCU device as of today has 4 MB ROM and 512 RAM.
 External memory can be added to these devices, but it seems
impractically slow for general purpose use. Â So I wonder, what kind of
Linux is this?
Any information is highly appreciated.
Cheers,
Oleg
On Mon, 2018-07-30 at 17:58 +0900, Yoshinori Sato wrote:
> Hello.
>
> I want added rx-*-linux target.
> rx-elf is compatible Renesas toolchain. It different standard ELF
> format.
> rx-*-linux have standard ELF format for RX processor.
>
> diff --git a/bfd/ChangeLog b/bfd/ChangeLog
> index 34b0465ba4..28439fb20c 100644
> --- a/bfd/ChangeLog
> +++ b/bfd/ChangeLog
> @@ -1,3 +1,12 @@
> +2018-07-30  Yoshinori Sato  <ysato@users.sourceforge.jp>
> +
> + * config.bfd: Add rx-*-linux.
> + * congigure.ac: Likewise.
> + * elf32-rx.c (rx_linux_object_p): New function.
> + (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME)
> + (elf_backend_object_p, elf32_bed): Define rx-*-linux.
> + * targets.c: Add rx_elf32_linux_le_vec.
> +
>  2018-07-27  John Darrington  <john@darrington.wattle.id.au>
> Â
> Â * elf32-s12z.c (ELF_TARGET_ID): Don't define.
> diff --git a/bfd/config.bfd b/bfd/config.bfd
> index 6391f35684..4ab636c62a 100644
> --- a/bfd/config.bfd
> +++ b/bfd/config.bfd
> @@ -1196,6 +1196,10 @@ case "${targ}" in
> Â Â Â Â Â targ_selvecs="rx_elf32_be_vec rx_elf32_le_vec
> rx_elf32_be_ns_vec"
> Â Â Â Â Â targ_underscore=yes
> Â Â Â Â Â ;;
> +Â Â rx-*-linux*)
> +Â Â Â Â targ_defvec=rx_elf32_linux_le_vec
> +Â Â Â Â targ_selvecs="rx_elf32_linux_le_vec"
> +Â Â Â Â ;;
> Â
> Â Â Â s390-*-linux*)
> Â Â Â Â Â targ_defvec=s390_elf32_vec
> diff --git a/bfd/configure.ac b/bfd/configure.ac
> index c6193cd8a4..d18b726a35 100644
> --- a/bfd/configure.ac
> +++ b/bfd/configure.ac
> @@ -610,6 +610,7 @@ do
> Â Â Â Â Â rx_elf32_be_vec) Â tb="$tb elf32-rx.lo elf32.lo
> $elf" ;;
> Â Â Â Â Â rx_elf32_be_ns_vec) Â tb="$tb elf32-rx.lo elf32.lo
> $elf" ;;
> Â Â Â Â Â rx_elf32_le_vec) Â tb="$tb elf32-rx.lo elf32.lo
> $elf" ;;
> +Â Â Â Â rx_elf32_linux_le_vec) Â tb="$tb elf32-rx.lo elf32.lo
> $elf" ;;
> Â Â Â Â Â s390_elf32_vec) Â tb="$tb elf32-s390.lo elf32.lo
> $elf" ;;
> Â Â Â Â Â s390_elf64_vec) Â tb="$tb elf64-s390.lo elf64.lo
> $elf"; target_size=64 ;;
> Â Â Â Â Â score_elf32_be_vec) Â tb="$tb elf32-score.lo
> elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;;
> diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c
> index 1f70b97a34..ddcf5e980f 100644
> --- a/bfd/elf32-rx.c
> +++ b/bfd/elf32-rx.c
> @@ -3310,6 +3310,14 @@ rx_elf_object_p (bfd * abfd)
> Â
> Â Â Â return TRUE;
> Â }
> +
> +static bfd_boolean
> +rx_linux_object_p (bfd * abfd)
> +{
> +Â Â bfd_default_set_arch_mach (abfd, bfd_arch_rx,
> +Â Â Â Â Â Â Â Â Â Â Â elf32_rx_machine (abfd));
> +Â Â return TRUE;
> +}
> Â Â
> Â
> Â #ifdef DEBUG
> @@ -4059,3 +4067,18 @@ rx_additional_link_map_text (bfd *obfd, struct
> bfd_link_info *info, FILE *mapfil
> Â #define elf32_bed elf32_rx_be_ns_bed
> Â
> Â #include "elf32-target.h"
> +
> +#undef TARGET_LITTLE_SYM
> +#define TARGET_LITTLE_SYM rx_elf32_linux_le_vec
> +#undef  TARGET_LITTLE_NAME
> +#define TARGET_LITTLE_NAME "elf32-rx-linux"
> +#undef  TARGET_BIG_SYM
> +#undef  TARGET_BIG_NAME
> +
> +#undef  elf_backend_object_p
> +#define elf_backend_object_p rx_linux_object_
> p
> +#undef  elf_symbol_leading_char
> +#undef elf32_bed
> +#define elf32_bed elf32_rx_le
> _linux_bed
> +
> +#include "elf32-target.h"
> diff --git a/bfd/targets.c b/bfd/targets.c
> index 531703d226..019b9002bf 100644
> --- a/bfd/targets.c
> +++ b/bfd/targets.c
> @@ -775,6 +775,7 @@ extern const bfd_target rs6000_xcoff_vec;
> Â extern const bfd_target rx_elf32_be_vec;
> Â extern const bfd_target rx_elf32_be_ns_vec;
> Â extern const bfd_target rx_elf32_le_vec;
> +extern const bfd_target rx_elf32_linux_le_vec;
> Â extern const bfd_target s390_elf32_vec;
> Â extern const bfd_target s390_elf64_vec;
> Â extern const bfd_target score_elf32_be_vec;
> diff --git a/gas/ChangeLog b/gas/ChangeLog
> index f2a0c6a408..5077609109 100644
> --- a/gas/ChangeLog
> +++ b/gas/ChangeLog
> @@ -1,3 +1,8 @@
> +2018-07-30  Yoshinori Sato  <ysato@users.sourceforge.jp>
> +
> + * configure.tgt: Add rx-*-linux.
> + * config/tc-rx.h (TARGET_FORMAT): Add "elf32-rx-linux".
> +
>  2018-07-29  John David Anglin  <danglin@gcc.gnu.org>
> Â
> Â * config/tc-hppa.c: Include "struc-symbol.h".
> diff --git a/gas/config/tc-rx.h b/gas/config/tc-rx.h
> index bf1f283d3d..78b2bedc9f 100644
> --- a/gas/config/tc-rx.h
> +++ b/gas/config/tc-rx.h
> @@ -31,7 +31,11 @@ extern int target_big_endian;
>  /* Instruction bytes are big endian, data bytes can be either.  */
> Â #define TARGET_BYTES_BIG_ENDIAN 0
> Â
> +#ifndef TE_LINUX
> Â #define TARGET_FORMAT (target_big_endian ? "elf32-rx-be" : "elf32-
> rx-le")
> +#else
> +#define TARGET_FORMAT "elf32-rx-linux"
> +#endif
> Â
>  /* We don't need to handle .word strangely.  */
> Â #define WORKING_DOT_WORD
> diff --git a/gas/configure.tgt b/gas/configure.tgt
> index 6df7dea31f..1122430104 100644
> --- a/gas/configure.tgt
> +++ b/gas/configure.tgt
> @@ -361,6 +361,8 @@ case ${generic_target} in
> Â
> Â Â Â riscv*-*-*) fmt=elf endian=little
> ;;
> Â
> +Â Â rx-*-linux*) fmt=elf em=linux ;;
> +
> Â Â Â s390-*-linux-*) fmt=elf em=linux ;;
> Â Â Â s390-*-tpf*) fmt=elf ;;
>
More information about the Binutils
mailing list