summaryrefslogtreecommitdiffstats
path: root/rtemstoolkit/elftoolchain/common/native-elf-format
diff options
context:
space:
mode:
Diffstat (limited to 'rtemstoolkit/elftoolchain/common/native-elf-format')
-rwxr-xr-xrtemstoolkit/elftoolchain/common/native-elf-format9
1 files changed, 6 insertions, 3 deletions
diff --git a/rtemstoolkit/elftoolchain/common/native-elf-format b/rtemstoolkit/elftoolchain/common/native-elf-format
index 4b06672..2bdd914 100755
--- a/rtemstoolkit/elftoolchain/common/native-elf-format
+++ b/rtemstoolkit/elftoolchain/common/native-elf-format
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: native-elf-format 2064 2011-10-26 15:12:32Z jkoshy $
+# $Id: native-elf-format 3293 2016-01-07 19:26:27Z emaste $
#
# Find the native ELF format for a host platform by compiling a
# test object and examining the resulting object.
@@ -19,7 +19,7 @@ touch ${tmp_c}
echo "/* Generated by ${program} on `date` */"
cc -c ${tmp_c} -o ${tmp_o}
-LANG="C" readelf -h ${tmp_o} | awk '
+LC_ALL=C readelf -h ${tmp_o} | awk '
$1 ~ "Class:" {
sub("ELF","",$2); elfclass = $2;
}
@@ -33,7 +33,9 @@ $1 ~ "Data:" {
$1 ~ "Machine:" {
if (match($0, "Intel.*386")) {
elfarch = "EM_386";
- } else if (match($0, ".*X86-64")) {
+ } else if (match($0, "MIPS")) {
+ elfarch = "EM_MIPS";
+ } else if (match($0, ".*[xX]86-64")) {
elfarch = "EM_X86_64";
} else {
elfarch = "unknown";
@@ -44,3 +46,4 @@ END {
printf("#define ELFTC_ARCH %s\n", elfarch);
printf("#define ELFTC_BYTEORDER ELFDATA2%s\n", elfdata);
}'
+