aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-08 07:31:09 +0000
committerIan Lance Taylor <iant@google.com>2008-02-08 07:31:09 +0000
commitb0d8593d63e73ec1e1afa041abea93b26bba3597 (patch)
tree876fad26abcbecb59151d893ab3124ee507fc811 /gold
parentbc644c6cfca852cd34e486a018bfde7fd1ac55e8 (diff)
downloadgdb-b0d8593d63e73ec1e1afa041abea93b26bba3597.zip
gdb-b0d8593d63e73ec1e1afa041abea93b26bba3597.tar.gz
gdb-b0d8593d63e73ec1e1afa041abea93b26bba3597.tar.bz2
Don't read linker scripts in binary mode.
Diffstat (limited to 'gold')
-rw-r--r--gold/script.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/gold/script.cc b/gold/script.cc
index fc510a5..68784f6 100644
--- a/gold/script.cc
+++ b/gold/script.cc
@@ -1412,8 +1412,11 @@ read_script_file(const char* filename, Command_line* cmdline,
// so we invent a fake value.
const Task* task = reinterpret_cast<const Task*>(-1);
- Input_file_argument input_argument(filename, false, "", false,
- cmdline->position_dependent_options());
+ // We don't want this file to be opened in binary mode.
+ Position_dependent_options posdep = cmdline->position_dependent_options();
+ if (posdep.input_format() == General_options::OBJECT_FORMAT_BINARY)
+ posdep.set_input_format("elf");
+ Input_file_argument input_argument(filename, false, "", false, posdep);
Input_file input_file(&input_argument);
if (!input_file.open(cmdline->options(), dirsearch, task))
return false;