Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Upgrade RTEMS, fix clean order, newlib fix.

  • Loading branch information...
commit d911e7406728b2dcf338af38f4177d86c366ee08 1 parent 60fcbc4
@atgreen authored
View
4 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.
View
28 build.xml
@@ -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)"/>
@@ -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>
<!-- =================================================================== -->
View
40 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
View
3  elf2flt/Makefile.in
@@ -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@
View
2  elf2flt/README
@@ -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:
View
44 elf2flt/configure
@@ -638,6 +638,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
SYMBOL_PREFIX
+always_reloc_text
emit_ctor_dtor
emit_relocs
got_check
@@ -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
@@ -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
@@ -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
@@ -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
View
31 elf2flt/configure.in
@@ -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 ]
)
@@ -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 ]
)
@@ -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
@@ -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)
View
2  elf2flt/elf2flt.c
@@ -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);
View
11 elf2flt/elf2flt.ld.in
@@ -5,6 +5,11 @@ MEMORY {
flatmem : ORIGIN = 0x0, LENGTH = 0xfffffff
}
+PHDRS {
+ text PT_LOAD ;
+ data PT_LOAD ;
+}
+
SECTIONS {
.text 0x0 : {
@@ -38,7 +43,7 @@ W_RODAT *(.gnu.linkonce.r*)
. = ALIGN(0x20) ;
@SYMBOL_PREFIX@_etext = . ;
- } > flatmem
+ } > flatmem :text
.data : {
. = ALIGN(0x4) ;
@@ -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 */
@@ -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 : {
View
8 elf2flt/flthdr.c
@@ -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;
@@ -353,6 +354,7 @@ main(int argc, char *argv[])
usage("invalid option");
break;
}
+ noargs = 0;
}
if (optind >= argc)
@@ -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)
View
82 elf2flt/ld-elf2flt.c
@@ -46,7 +46,6 @@ static const char *elf2flt = NULL;
static const char *nm = NULL;
static const char *objdump = NULL;
static const char *objcopy = NULL;
-static const char *tooldir = ".";
static const char *ldscriptpath = BINUTILS_LDSCRIPTDIR;
/* A list of sed commands */
@@ -120,6 +119,8 @@ execute(const char *command, const char *output, const options_t *options, ...)
fprintf(stderr, "Invoking:");
for (ix = 0; ix != opts.num - 1; ix++)
fprintf(stderr, " '%s'", opts.options[ix]);
+ if (output)
+ fprintf(stderr, " > '%s'", output);
fprintf(stderr, "\n");
}
@@ -173,7 +174,7 @@ do_sed(const sed_commands_t *sed, const char *name_in, const char *name_out)
if (replacement)
fprintf(stderr, "\t-e 's/%s/%s/' \\\n", pattern, replacement);
else
- fprintf(stderr, "\t-e 'd/%s/' \\\n", pattern);
+ fprintf(stderr, "\t-e '/%s/d' \\\n", pattern);
}
fprintf(stderr, "\t%s > %s\n", name_in, name_out);
}
@@ -452,7 +453,7 @@ static void parse_args(int argc, char **argv)
} else if (streq(arg, "-r") || streq(arg, "-Ur")) {
flag_final = 0;
append_option(&other_options, arg);
- } else if (streq(arg, "-v") || streq(arg, "--verbose")) {
+ } else if (streq(arg, "--verbose")) {
flag_verbose = 1;
append_option(&other_options, arg);
} else if (streqn(arg, "-m")) {
@@ -471,47 +472,51 @@ static void parse_args(int argc, char **argv)
int main(int argc, char *argv[])
{
- const char *ptr;
- char *tmp;
const char *argv0 = argv[0];
- size_t len;
+ const char *argv0_dir = make_relative_prefix(argv0, "/", "/");
+ char *tooldir = argv0_dir;
+ char *bindir = argv0_dir;
+ char *tmp;
struct stat buf;
const char *have_exe = NULL;
int status;
- len = strlen(argv0);
#ifdef __WIN32
/* Remove the .exe extension, if it's there. */
+ size_t len = strlen(argv0);
if (len > 4 && streq(&argv0[len - 4], ".exe")) {
have_exe = ".exe";
len -= 4;
argv0 = tmp = xstrdup(argv0);
tmp[len] = 0;
+ argv[0][len] = '\0';
}
#endif
- elf2flt_progname = argv0;
- for (ptr = elf2flt_progname + len; ptr != elf2flt_progname; ptr--)
- if (IS_DIR_SEPARATOR(ptr[-1])) {
- tooldir = tmp = xmalloc(len);
- memcpy(tmp, argv0, len);
- tmp[ptr - elf2flt_progname - 1] = 0;
- elf2flt_progname = ptr;
- /* The standard binutils tool layout has:
-
- bin/<TARGET_ALIAS>-foo
- lib/
- <TARGET_ALIAS>/bin/foo
- <TARGET_ALIAS>/lib
-
- It's <TARGET_ALIAS>/ that we want here: files in lib/ are for
- the host while those in <TARGET_ALIAS>/lib are for the target. */
- if (streqn(elf2flt_progname, TARGET_ALIAS)) {
- tmp = concat(tooldir, "/../" TARGET_ALIAS "/bin", NULL);
- if (stat(tmp, &buf) == 0 && S_ISDIR(buf.st_mode))
- tooldir = tmp;
- }
- break;
+ elf2flt_progname = lbasename(argv0);
+
+ /* The standard binutils tool layout has:
+
+ bin/<TARGET_ALIAS>-foo
+ lib/
+ <TARGET_ALIAS>/bin/foo
+ <TARGET_ALIAS>/lib
+
+ It's <TARGET_ALIAS>/ that we want here: files in lib/ are for
+ the host while those in <TARGET_ALIAS>/lib are for the target.
+ Make bindir point to the bin dir for bin/<TARGET_ALIAS>-foo.
+ Make tooldir point to the bin dir for <TARGET_ALIAS>/bin/foo. */
+ if (streqn(elf2flt_progname, TARGET_ALIAS)) {
+ tmp = concat(argv0_dir, "../" TARGET_ALIAS "/bin", NULL);
+ if (stat(tmp, &buf) == 0 && S_ISDIR(buf.st_mode)) {
+ tooldir = concat(tmp, "/", NULL);
}
+ } else {
+ tmp = concat(argv0_dir, "../../bin", NULL);
+ if (stat(tmp, &buf) == 0 && S_ISDIR(buf.st_mode)) {
+ bindir = concat(tmp, "/", NULL);
+ }
+ }
+
/* Typically ld-elf2flt is invoked as `ld` which means error
* messages from it will look like "ld: " which is completely
* confusing. So append an identifier to keep things clear.
@@ -520,25 +525,20 @@ int main(int argc, char *argv[])
xmalloc_set_program_name(elf2flt_progname);
- tmp = xmalloc(len + 16);
- memcpy(tmp, argv0, len);
- while (len && tmp[len - 1] != '-' && !IS_DIR_SEPARATOR(tmp[len - 1]))
- len--;
- tmp[len] = 0;
-
- linker = concat(tmp, "ld.real", have_exe, NULL);
- elf2flt = concat(tmp, "elf2flt", have_exe, NULL);
- nm = concat(tmp, "nm", have_exe, NULL);
- objdump = concat(tooldir, "/../../bin/", TARGET_ALIAS, "-objdump", have_exe, NULL);
- objcopy = concat(tooldir, "/../../bin/", TARGET_ALIAS, "-objcopy", have_exe, NULL);
+ linker = concat(tooldir, "ld.real", have_exe, NULL);
+ elf2flt = concat(tooldir, "elf2flt", have_exe, NULL);
+ nm = concat(tooldir, "nm", have_exe, NULL);
+ objdump = concat(bindir, TARGET_ALIAS "-objdump", have_exe, NULL);
+ objcopy = concat(bindir, TARGET_ALIAS "-objcopy", have_exe, NULL);
if (stat(ldscriptpath, &buf) || !S_ISDIR(buf.st_mode))
- ldscriptpath = concat(tooldir, "/../lib", NULL);
+ ldscriptpath = concat(tooldir, "../lib", NULL);
parse_args(argc, argv);
if (flag_verbose) {
fprintf(stderr, "argv[0] = '%s'\n", argv[0]);
+ fprintf(stderr, "bindir = '%s'\n", bindir);
fprintf(stderr, "tooldir = '%s'\n", tooldir);
fprintf(stderr, "linker = '%s'\n", linker);
fprintf(stderr, "elf2flt = '%s'\n", elf2flt);
View
2  elf2flt/stubs.h
@@ -41,7 +41,7 @@
#define _debug(lvl, fmt, args...) \
do { \
if (lvl <= DEBUG) { \
- fprintf(stderr, "%s:%i: " fmt, __func__, __LINE__, ## args); \
+ fprintf(stderr, "%s:%i: " fmt, __func__, __LINE__ , ## args); \
fflush(stderr); \
} \
} while (0)
2  rtems
@@ -1 +1 @@
-Subproject commit f4c10313af854835f119972dc800aa0906ff92f5
+Subproject commit 6edb92b2c912b835b41e9a6ccbc6c8f501dbb863
View
2  src/newlib/libc/sys/rtems/sys/dirent.h
@@ -50,7 +50,7 @@ struct dirent {
int scandir ( const char *dirname,
struct dirent *** namelist,
- int (*select)(struct dirent *),
+ int (*select)(const struct dirent *),
int (*dcomp)(const struct dirent **, const struct dirent **)
);
Please sign in to comment.
Something went wrong with that request. Please try again.