Skip to content

Commit 4849470

Browse files
committed
Add moxiebox target
1 parent e76c5d1 commit 4849470

11 files changed

+52
-8
lines changed

bfd/ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2014-07-27 Anthony Green <[email protected]>
2+
3+
* config.bfd: Add moxie-*-moxiebox*.
4+
15
2014-07-21 Joel Sherrill <[email protected]>
26

37
Add or reactivate or1k-*-rtems*

bfd/config.bfd

+4
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@ case "${targ}" in
446446
targ_selvecs=moxie_elf32_le_vec
447447
;;
448448

449+
moxie-*-moxiebox*)
450+
targ_defvec=moxie_elf32_le_vec
451+
;;
452+
449453
h8300*-*-rtemscoff*)
450454
targ_defvec=h8300_coff_vec
451455
targ_underscore=yes

gas/ChangeLog

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2014-07-27 Anthony Green <[email protected]>
2+
3+
* configure.tgt (generic_target): Add moxie-*-moxiebox*
4+
* config/tc-moxie.c: Remove moxie_target_format.
5+
(md_begin): Set default target_big_endian.
6+
* config/tc-moxie.h: Only set TARGET_BYTES_BIG_ENDIAN if unset.
7+
(TARGET_FORMAT): Set based on target_big_endian.
8+
19
2014-07-26 Alan Modra <[email protected]>
210

311
* config/bfin-parse.y: Don't include obstack.h.

gas/config/tc-moxie.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ static valueT md_chars_to_number (char * buf, int n);
4646

4747
/* Byte order. */
4848
extern int target_big_endian;
49-
const char *moxie_target_format = DEFAULT_TARGET_FORMAT;
5049

5150
void
5251
md_operand (expressionS *op __attribute__((unused)))
@@ -75,6 +74,8 @@ md_begin (void)
7574
for (count = 0, opcode = moxie_form3_opc_info; count++ < 10; opcode++)
7675
hash_insert (opcode_hash_control, opcode->name, (char *) opcode);
7776

77+
target_big_endian = TARGET_BYTES_BIG_ENDIAN;
78+
7879
bfd_set_arch_mach (stdoutput, TARGET_ARCH, 0);
7980
}
8081

@@ -617,11 +618,9 @@ md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
617618
{
618619
case OPTION_EB:
619620
target_big_endian = 1;
620-
moxie_target_format = "elf32-bigmoxie";
621621
break;
622622
case OPTION_EL:
623623
target_big_endian = 0;
624-
moxie_target_format = "elf32-littlemoxie";
625624
break;
626625
default:
627626
return 0;

gas/config/tc-moxie.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
2020

2121
#define TC_MOXIE 1
22+
#ifndef TARGET_BYTES_BIG_ENDIAN
2223
#define TARGET_BYTES_BIG_ENDIAN 1
24+
#endif
2325
#define WORKING_DOT_WORD
2426

2527
/* This macro is the BFD architecture to pass to `bfd_set_arch_mach'. */
26-
const char *moxie_target_format;
27-
#define DEFAULT_TARGET_FORMAT "elf32-bigmoxie"
28-
#define TARGET_FORMAT moxie_target_format
28+
#define TARGET_FORMAT (target_big_endian ? "elf32-bigmoxie" : "elf32-littlemoxie")
2929

3030
#define TARGET_ARCH bfd_arch_moxie
3131

gas/configure.tgt

+3-2
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,10 @@ case ${generic_target} in
339339
mn10300-*-linux*) fmt=elf em=linux ;;
340340
mn10300-*-*) fmt=elf ;;
341341

342-
moxie-*-uclinux) fmt=elf em=linux;;
342+
moxie-*-uclinux) fmt=elf em=linux ;;
343+
moxie-*-moxiebox*) fmt=elf endian=little ;;
343344
moxie-*-*) fmt=elf ;;
344-
345+
345346
mt-*-elf) fmt=elf bfd_gas=yes ;;
346347

347348
msp430-*-*) fmt=elf ;;

ld/ChangeLog

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2014-07-27 Anthony Green <[email protected]>
2+
3+
* Makefile.am (ALL_EMULATION_SOURCES): Add moxiebox support.
4+
(emoxiebox.c): Build.
5+
* configure.tgt (targ_extra_ofiles): Add moxie-*-moxiebox*.
6+
* emulparams/moxiebox.sh (TEXT_START_ADDR): New file.
7+
* Makefile.in: Rebuilt.
8+
19
2014-07-17 Stefan Kristiansson <[email protected]>
210

311
* emulparams/elf32or1k_linux.sh (TEXT_START_ADDR): Increase from

ld/Makefile.am

+4
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ ALL_EMULATION_SOURCES = \
247247
eelf32microblazeel.c \
248248
eelf32microblaze.c \
249249
eelf32moxie.c \
250+
emoxiebox.c \
250251
eelf32mt.c \
251252
eelf32or1k.c \
252253
eelf32or1k_linux.c \
@@ -1160,6 +1161,9 @@ eelf32mipswindiss.c: $(srcdir)/emulparams/elf32mipswindiss.sh $(ELF_DEPS) \
11601161
eelf32moxie.c: $(srcdir)/emulparams/elf32moxie.sh \
11611162
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
11621163
1164+
emoxiebox.c: $(srcdir)/emulparams/moxiebox.sh \
1165+
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
1166+
11631167
eelf32mt.c: $(srcdir)/emulparams/elf32mt.sh \
11641168
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
11651169

ld/Makefile.in

+5
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ ALL_EMULATION_SOURCES = \
555555
eelf32microblazeel.c \
556556
eelf32microblaze.c \
557557
eelf32moxie.c \
558+
emoxiebox.c \
558559
eelf32mt.c \
559560
eelf32or1k.c \
560561
eelf32or1k_linux.c \
@@ -1173,6 +1174,7 @@ distclean-compile:
11731174
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32microblazeel.Po@am__quote@
11741175
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Po@am__quote@
11751176
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32moxie.Po@am__quote@
1177+
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emoxiebox.Po@am__quote@
11761178
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mt.Po@am__quote@
11771179
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32or1k.Po@am__quote@
11781180
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32or1k_linux.Po@am__quote@
@@ -2600,6 +2602,9 @@ eelf32mipswindiss.c: $(srcdir)/emulparams/elf32mipswindiss.sh $(ELF_DEPS) \
26002602
eelf32moxie.c: $(srcdir)/emulparams/elf32moxie.sh \
26012603
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26022604
2605+
emoxiebox.c: $(srcdir)/emulparams/moxiebox.sh \
2606+
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
2607+
26032608
eelf32mt.c: $(srcdir)/emulparams/elf32mt.sh \
26042609
$(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26052610

ld/configure.tgt

+2
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ fr30-*-*) targ_emul=elf32fr30
188188
frv-*-*linux*) targ_emul=elf32frvfd ;;
189189
frv-*-*) targ_emul=elf32frv ; targ_extra_emuls="elf32frvfd"
190190
;;
191+
moxie-*-moxiebox*) targ_emul=moxiebox
192+
;;
191193
moxie-*-*) targ_emul=elf32moxie
192194
;;
193195
h8300-*-hms* | h8300-*-coff* | h8300-*-rtemscoff*)

ld/emulparams/moxiebox.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
SCRIPT_NAME=elf
2+
TEMPLATE_NAME=generic
3+
EXTRA_EM_FILE=genelf
4+
OUTPUT_FORMAT="elf32-littlemoxie"
5+
TEXT_START_ADDR=0x1000
6+
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
7+
ARCH=moxie
8+
EMBEDDED=yes
9+
STACK_ADDR=0x400000

0 commit comments

Comments
 (0)