--- /dev/null
+#!/bin/sh
+
+# Linker from TI ARM compiler version 5.1.1 cannot link the library when it contains ARM.attributes section.
+# Therefore we strip this section from all object files in the library.
+
+set -e
+
+rm -rf orig/*.obj
+rm -rf stripped-attr
+
+mkdir -p stripped-attr
+mkdir -p orig
+
+(cd orig && arm-none-eabi-ar x ../F021_API_CortexR4_BE.lib && chmod +r *.obj)
+
+for fin in orig/*.obj ; do
+
+ fout=stripped-attr/"$(basename "$fin")"
+
+ arm-none-eabi-objcopy --remove-section=.ARM.attributes "$fin" "$fout"
+
+done
+
+arm-none-eabi-ar r stripped-attr/F021_API_CortexR4_BE.lib stripped-attr/*.obj
+