summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2016-01-12 12:38:43 +0000
committerSimon Atanasyan <simon@atanasyan.com>2016-01-12 12:38:43 +0000
commit49f98c742cf78f740face5cb3ce5d45900a1362f (patch)
treefa7fc2793366e89ea71d39c62d7bd12de0a0214b
parent6abd69a60b74584e86102d400880d2ae00932f84 (diff)
downloadbcm5719-llvm-49f98c742cf78f740face5cb3ce5d45900a1362f.tar.gz
bcm5719-llvm-49f98c742cf78f740face5cb3ce5d45900a1362f.zip
[ELF][MIPS] Do not use 'sed' to modify binary files
On Windows different versions of 'sed' work in different text/binary mode by default. If default mode is text, sed produces corrupted binary files. Unfortunately there is no standard command line option to select the mode. Some 'sed' support '-b' to switch to binary mode, while other ones support '--text' option and does not have '-b' option at all. llvm-svn: 257471
-rw-r--r--lld/test/ELF/Inputs/mips-gp-disp-def.s8
-rw-r--r--lld/test/ELF/Inputs/mips-gp-disp.sobin0 -> 131832 bytes
-rw-r--r--lld/test/ELF/mips-gp-disp.s9
3 files changed, 3 insertions, 14 deletions
diff --git a/lld/test/ELF/Inputs/mips-gp-disp-def.s b/lld/test/ELF/Inputs/mips-gp-disp-def.s
deleted file mode 100644
index 79306df9bfc..00000000000
--- a/lld/test/ELF/Inputs/mips-gp-disp-def.s
+++ /dev/null
@@ -1,8 +0,0 @@
-# We cannot create a shared library with defined _gp_disp symbol
-# so we use a workaround - create a library with XXXXXXXX symbols
-# and use 'sed' to replace it by _gp_disp right in the binary file.
- .data
- .globl XXXXXXXX
- .space 16
-XXXXXXXX:
- .space 4
diff --git a/lld/test/ELF/Inputs/mips-gp-disp.so b/lld/test/ELF/Inputs/mips-gp-disp.so
new file mode 100644
index 00000000000..9cbb4372060
--- /dev/null
+++ b/lld/test/ELF/Inputs/mips-gp-disp.so
Binary files differ
diff --git a/lld/test/ELF/mips-gp-disp.s b/lld/test/ELF/mips-gp-disp.s
index 7914a223446..b7f0517a134 100644
--- a/lld/test/ELF/mips-gp-disp.s
+++ b/lld/test/ELF/mips-gp-disp.s
@@ -1,14 +1,11 @@
# Check that even if _gp_disp symbol is defined in the shared library
# we use our own value.
-# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
-# RUN: %S/Inputs/mips-gp-disp-def.s -o %t-ext.o
-# RUN: ld.lld -shared -o %t-ext-int.so %t-ext.o
-# RUN: sed -e 's/XXXXXXXX/_gp_disp/g' %t-ext-int.so > %t-ext.so
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
-# RUN: ld.lld -shared -o %t.so %t.o %t-ext.so
+# RUN: ld.lld -shared -o %t.so %t.o %S/Inputs/mips-gp-disp.so
# RUN: llvm-readobj -symbols %t.so | FileCheck -check-prefix=INT-SO %s
-# RUN: llvm-readobj -symbols %t-ext.so | FileCheck -check-prefix=EXT-SO %s
+# RUN: llvm-readobj -symbols %S/Inputs/mips-gp-disp.so \
+# RUN: | FileCheck -check-prefix=EXT-SO %s
# RUN: llvm-objdump -d -t %t.so | FileCheck -check-prefix=DIS %s
# REQUIRES: mips
OpenPOWER on IntegriCloud