Skip to content

Commit

Permalink
Upgrade RTEMS, fix clean order, newlib fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
atgreen committed Jun 14, 2011
1 parent 60fcbc4 commit d911e74
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 105 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
2011-06-13 Anthony Green <green@moxielogic.com>

* build.xml: Reorder clean script.

2011-06-12 <green@moxielogic.com>

* build.xml: Build newlib and libgloss at the same time.
Expand Down
28 changes: 14 additions & 14 deletions build.xml
Expand Up @@ -44,20 +44,6 @@
<!-- Clean the tree -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="dist"/>
<delete dir="root"/>
<delete dir="arm-root"/>
<delete dir="build"/>
<delete dir="arm-build"/>
<delete>
<fileset dir="." includes="**/*~"/>
<fileset dir="." includes="**/.#*~"/>
<fileset dir="." includes="*~"/>
</delete>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd benchmarks/MiBench; ./all__delete_work_dirs)"/>
</exec>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd qemu; make distclean > /dev/null 2>&amp;1)"/>
Expand All @@ -74,6 +60,20 @@
<arg value="--directory=uClibc"/>
<arg value="clean"/>
</exec>
<delete dir="dist"/>
<delete dir="root"/>
<delete dir="arm-root"/>
<delete dir="build"/>
<delete dir="arm-build"/>
<delete>
<fileset dir="." includes="**/*~"/>
<fileset dir="." includes="**/.#*~"/>
<fileset dir="." includes="*~"/>
</delete>
<exec executable="sh">
<arg value="-c"/>
<arg value="(cd benchmarks/MiBench; ./all__delete_work_dirs)"/>
</exec>
</target>

<!-- =================================================================== -->
Expand Down
40 changes: 20 additions & 20 deletions elf2flt/CVS/Entries
@@ -1,22 +1,22 @@
/config.sub/1.8/Wed Jan 11 03:39:16 2006/-ko/
/elf2flt.c/1.63/Tue Jul 7 04:39:42 2009/-ko/
/.gitignore/1.2/Wed Nov 18 20:11:46 2009//
/LICENSE.TXT/1.1/Wed Nov 18 20:11:46 2009//
/Makefile.in/1.27/Wed Dec 9 22:33:40 2009/-ko/
/README/1.5/Wed Nov 18 20:11:46 2009/-ko/
/compress.c/1.3/Wed Nov 18 20:11:46 2009//
/compress.h/1.2/Wed Nov 18 20:11:46 2009//
/config.guess/1.2/Wed Nov 18 20:11:46 2009/-ko/
/configure/1.19/Wed Nov 18 20:11:46 2009/-ko/
/configure.in/1.18/Wed Nov 18 20:11:46 2009/-ko/
/cygwin-elf.h/1.4/Wed Nov 18 20:11:46 2009//
/e1-elf2flt.ld/1.1/Wed Nov 18 20:11:46 2009//
/elf2flt.ld.in/1.3/Wed Nov 18 20:11:46 2009//
/flat.h/1.8/Wed Nov 18 20:11:46 2009/-ko/
/flthdr.c/1.16/Wed Nov 18 20:11:46 2009/-ko/
/install-sh/1.1.1.1/Wed Nov 18 20:11:46 2009/-ko/
/ld-elf2flt.c/1.2/Wed Dec 9 22:33:41 2009//
/ld-elf2flt.in/1.23/Wed Nov 18 20:11:46 2009//
/stubs.c/1.4/Wed Nov 18 20:11:46 2009//
/stubs.h/1.2/Wed Nov 18 20:11:46 2009//
/.gitignore/1.2/Sun Jun 5 16:54:05 2011//
/LICENSE.TXT/1.1/Sun Jun 5 16:54:05 2011//
/Makefile.in/1.28/Mon Jun 13 15:00:24 2011/-ko/
/README/1.6/Mon Jun 13 15:00:24 2011/-ko/
/compress.c/1.3/Sun Jun 5 16:54:05 2011//
/compress.h/1.2/Sun Jun 5 16:54:05 2011//
/config.guess/1.2/Sun Jun 5 16:54:05 2011/-ko/
/configure/1.21/Mon Jun 13 15:00:24 2011/-ko/
/configure.in/1.20/Mon Jun 13 15:00:24 2011/-ko/
/cygwin-elf.h/1.4/Sun Jun 5 16:54:05 2011//
/e1-elf2flt.ld/1.1/Sun Jun 5 16:54:05 2011//
/elf2flt.c/1.64/Result of merge/-ko/
/elf2flt.ld.in/1.5/Mon Jun 13 15:00:24 2011//
/flat.h/1.8/Sun Jun 5 16:54:05 2011/-ko/
/flthdr.c/1.17/Mon Jun 13 15:00:24 2011/-ko/
/install-sh/1.1.1.1/Sun Jun 5 16:54:05 2011/-ko/
/ld-elf2flt.c/1.6/Mon Jun 13 15:00:24 2011//
/ld-elf2flt.in/1.23/Sun Jun 5 16:54:05 2011//
/stubs.c/1.4/Sun Jun 5 16:54:05 2011//
/stubs.h/1.3/Mon Jun 13 15:00:24 2011//
D
3 changes: 2 additions & 1 deletion elf2flt/Makefile.in
Expand Up @@ -25,7 +25,8 @@ DEFS = @DEFS@ \
-DTARGET_ALIAS=\"$(TARGET)\" \
-DNO_GOT_CHECK=@got_check@ \
-DUSE_EMIT_RELOCS=@emit_relocs@ \
-DEMIT_CTOR_DTOR=@emit_ctor_dtor@
-DEMIT_CTOR_DTOR=@emit_ctor_dtor@ \
-DALWAYS_RELOC_TEXT=@always_reloc_text@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@

Expand Down
2 changes: 1 addition & 1 deletion elf2flt/README
Expand Up @@ -11,7 +11,7 @@ LICENSE.TXT for more details.

Elf2flt with PIC, ZFLAT and full reloc support. Currently supported
targets include: m68k/ColdFire, ARM, Sparc, NEC v850, MicroBlaze,
h8300 and SuperH.
h8300, SuperH, and Blackfin.

COMPILING:

Expand Down
44 changes: 35 additions & 9 deletions elf2flt/configure
Expand Up @@ -638,6 +638,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
SYMBOL_PREFIX
always_reloc_text
emit_ctor_dtor
emit_relocs
got_check
Expand Down Expand Up @@ -722,6 +723,7 @@ enable_ld_elf2flt_binary
enable_got_check
enable_emit_relocs
enable_emit_ctor_dtor
enable_always_reloc_text
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1358,20 +1360,28 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-ld-elf2flt-binary
use ld-elf2flt shell script
--disable-got-check - disable check for GOT (needed on H8)
--disable-emit-relocs - don't use the --emit-relocs (-q) linker option
--disable-got-check disable check for GOT (needed on H8)
--disable-emit-relocs don't use the --emit-relocs (-q) linker option
--enable-emit-ctor-dtor manually create ctor/dtor list
--enable-always-reloc-text
always process text relocs ignoring pic/got (needed
on Blackfin)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-zlib-prefix=<dir> path to installed zlib
--with-libbfd=<file> path to libbfd.a library to use
--with-libiberty=<file> path to libiberty.a library to use
--with-bfd-include-dir=<dir> include path for correct bfd.h
--with-binutils-include-dir=<dir> include path for binutils headers
--with-binutils-ldscript-dir=<dir> path to install elf2flt.ld
--with-binutils-build-dir=<dir> path to compiled binutils tree
--with-zlib-prefix=<dir>
path to installed zlib
--with-libbfd=<file> path to libbfd.a library to use
--with-libiberty=<file> path to libiberty.a library to use
--with-bfd-include-dir=<dir>
include path for correct bfd.h
--with-binutils-include-dir=<dir>
include path for binutils headers
--with-binutils-ldscript-dir=<dir>
path to install elf2flt.ld
--with-binutils-build-dir=<dir>
path to compiled binutils tree
Some influential environment variables:
CC C compiler command
Expand Down Expand Up @@ -1940,6 +1950,21 @@ fi
var_yn_to_10 emit_ctor_dtor
# Check whether --enable-always-reloc-text was given.
if test "${enable_always_reloc_text+set}" = set; then
enableval=$enable_always_reloc_text; always_reloc_text=$enableval
else
case $target in
bfin*) always_reloc_text=yes;;
*) always_reloc_text=no;;
esac
fi
var_yn_to_10 always_reloc_text
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
Expand Down Expand Up @@ -5128,6 +5153,7 @@ test "$GCC" = yes && CFLAGS="-Wall $CFLAGS"
ac_config_files="$ac_config_files ld-elf2flt.sh:ld-elf2flt.in Makefile elf2flt.ld"
cat >confcache <<\_ACEOF
Expand Down
31 changes: 22 additions & 9 deletions elf2flt/configure.in
Expand Up @@ -2,43 +2,43 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(elf2flt.c)

AC_ARG_WITH(zlib-prefix,
[ --with-zlib-prefix=<dir> path to installed zlib ],
AS_HELP_STRING([--with-zlib-prefix=<dir>], [path to installed zlib]),
[ ac_zlib_prefix=$withval ],
[ ac_zlib_prefix=NONE ]
)

AC_ARG_WITH(libbfd,
[ --with-libbfd=<file> path to libbfd.a library to use ],
AS_HELP_STRING([--with-libbfd=<file>], [path to libbfd.a library to use]),
[ ac_libbfd=$withval ],
[ ac_libbfd=NONE ]
)

AC_ARG_WITH(libiberty,
[ --with-libiberty=<file> path to libiberty.a library to use ],
AS_HELP_STRING([--with-libiberty=<file>], [path to libiberty.a library to use]),
[ ac_libiberty=$withval ],
[ ac_libiberty=NONE ]
)

AC_ARG_WITH(bfd-include-dir,
[ --with-bfd-include-dir=<dir> include path for correct bfd.h ],
AS_HELP_STRING([--with-bfd-include-dir=<dir>], [include path for correct bfd.h]),
[ ac_bfd_include_dir=$withval ],
[ ac_bfd_include_dir=NONE ]
)

AC_ARG_WITH(binutils-include-dir,
[ --with-binutils-include-dir=<dir> include path for binutils headers ],
AS_HELP_STRING([--with-binutils-include-dir=<dir>], [include path for binutils headers]),
[ ac_binutils_include_dir=$withval ],
[ ac_binutils_include_dir=NONE ]
)

AC_ARG_WITH(binutils-ldscript-dir,
[ --with-binutils-ldscript-dir=<dir> path to install elf2flt.ld ],
AS_HELP_STRING([--with-binutils-ldscript-dir=<dir>], [path to install elf2flt.ld]),
[ ac_binutils_ldscript_dir=$withval ],
[ ac_binutils_ldscript_dir=NONE ]
)

AC_ARG_WITH(binutils-build-dir,
[ --with-binutils-build-dir=<dir> path to compiled binutils tree ],
AS_HELP_STRING([--with-binutils-build-dir=<dir>], [path to compiled binutils tree]),
[ ac_binutils_build_dir=$withval ],
[ ac_binutils_build_dir=NONE ]
)
Expand All @@ -59,14 +59,14 @@ var_yn_to_10() {
}

AC_ARG_ENABLE(got-check,
[ --disable-got-check - disable check for GOT (needed on H8) ],
AS_HELP_STRING([--disable-got-check], [disable check for GOT (needed on H8)]),
[ got_check=$enableval ],
[ got_check=yes ]
)
var_yn_to_10 got_check

AC_ARG_ENABLE(emit-relocs,
[ --disable-emit-relocs - don't use the --emit-relocs (-q) linker option ],
AS_HELP_STRING([--disable-emit-relocs], [don't use the --emit-relocs (-q) linker option]),
[ emit_relocs=$enableval ],
[ emit_relocs=yes ]
)
Expand All @@ -79,6 +79,18 @@ AC_ARG_ENABLE(emit-ctor-dtor,
)
var_yn_to_10 emit_ctor_dtor

AC_ARG_ENABLE(always-reloc-text,
AS_HELP_STRING([--enable-always-reloc-text], [always process text relocs ignoring pic/got (needed on Blackfin)]),
[ always_reloc_text=$enableval ],
[
case $target in
bfin*) always_reloc_text=yes;;
*) always_reloc_text=no;;
esac
]
)
var_yn_to_10 always_reloc_text

AC_CANONICAL_HOST
AC_CANONICAL_TARGET

Expand Down Expand Up @@ -207,6 +219,7 @@ AC_SUBST(use_ld_elf2flt_binary)
AC_SUBST(got_check)
AC_SUBST(emit_relocs)
AC_SUBST(emit_ctor_dtor)
AC_SUBST(always_reloc_text)
AC_SUBST(SYMBOL_PREFIX)

AC_OUTPUT(ld-elf2flt.sh:ld-elf2flt.in Makefile elf2flt.ld)
Expand Down
2 changes: 1 addition & 1 deletion elf2flt/elf2flt.c
Expand Up @@ -398,7 +398,7 @@ dump_symbols(symbols, number_of_symbols);
* Only relocate things in the data sections if we are PIC/GOT.
* otherwise do text as well
*/
if (!pic_with_got && (a->flags & SEC_CODE))
if ((!pic_with_got || ALWAYS_RELOC_TEXT) && (a->flags & SEC_CODE))
sectionp = text + (a->vma - text_vma);
else if (a->flags & SEC_DATA)
sectionp = data + (a->vma - data_vma);
Expand Down
11 changes: 8 additions & 3 deletions elf2flt/elf2flt.ld.in
Expand Up @@ -5,6 +5,11 @@ MEMORY {
flatmem : ORIGIN = 0x0, LENGTH = 0xfffffff
}

PHDRS {
text PT_LOAD ;
data PT_LOAD ;
}

SECTIONS {

.text 0x0 : {
Expand Down Expand Up @@ -38,7 +43,7 @@ W_RODAT *(.gnu.linkonce.r*)

. = ALIGN(0x20) ;
@SYMBOL_PREFIX@_etext = . ;
} > flatmem
} > flatmem :text

.data : {
. = ALIGN(0x4) ;
Expand Down Expand Up @@ -76,7 +81,6 @@ R_RODAT *(.gnu.linkonce.r*)
*(__libc_atexit)
*(__libc_subinit)
*(__libc_subfreeres)
*(.note.ABI-tag)

/* microblaze-specific read-only small data area
and associated locating symbols */
Expand Down Expand Up @@ -130,8 +134,9 @@ TOR: @SYMBOL_PREFIX@__DTOR_END__ = .;
KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*)))
PROVIDE (@SYMBOL_PREFIX@__fini_array_end = .);
} > flatmem
} > flatmem :data

.note.ABI-tag : { *(.note.ABI-tag) } > flatmem
.eh_frame_hdr : { *(.eh_frame_hdr) } > flatmem
.eh_frame : { KEEP(*(.eh_frame)) } > flatmem
.gcc_except_table : {
Expand Down
8 changes: 5 additions & 3 deletions elf2flt/flthdr.c
Expand Up @@ -326,11 +326,12 @@ usage(char *s)
int
main(int argc, char *argv[])
{
int c;
int c, noargs;
char *ofile = NULL, *ifile;

elf2flt_progname = argv[0];

noargs = 1;
while ((c = getopt(argc, argv, "pPdzZrRuUkKs:o:")) != EOF) {
switch (c) {
case 'p': print = 1; break;
Expand All @@ -353,6 +354,7 @@ main(int argc, char *argv[])
usage("invalid option");
break;
}
noargs = 0;
}

if (optind >= argc)
Expand All @@ -361,9 +363,9 @@ main(int argc, char *argv[])
if (ofile && argc - optind > 1)
usage("-o can only be used with a single file");

if (!print && !docompress && !ramload && !stacksize) /* no args == print */
if (!print && noargs) /* no args == print */
print = argc - optind; /* greater than 1 is short format */

for (c = optind; c < argc; c++) {
ifile = argv[c];
if (!ofile)
Expand Down

0 comments on commit d911e74

Please sign in to comment.