1 // script.h -- handle linker scripts for gold -*- C++ -*-
3 // Copyright 2006, 2007 Free Software Foundation, Inc.
4 // Written by Ian Lance Taylor <iant@google.com>.
6 // This file is part of gold.
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 3 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 // MA 02110-1301, USA.
23 // We implement a subset of the original GNU ld linker script language
24 // for compatibility. The goal is not to implement the entire
25 // language. It is merely to implement enough to handle common uses.
26 // In particular we need to handle /usr/lib/libc.so on a typical
27 // GNU/Linux system, and we want to handle linker scripts used by the
28 // Linux kernel build.
36 class General_options;
47 // FILE was found as an argument on the command line, but was not
48 // recognized as an ELF file. Try to read it as a script. We've
49 // already read BYTES of data into P. Return true if the file was
50 // handled. This has to handle /usr/lib/libc.so on a GNU/Linux
54 read_input_script(Workqueue*, const General_options&, Symbol_table*, Layout*,
55 const Dirsearch&, Input_objects*, Input_group*,
56 const Input_argument*, Input_file*, const unsigned char* p,
57 off_t bytes, Task_token* this_blocker,
58 Task_token* next_blocker);
60 // FILE was found as an argument to --script (-T).
61 // Read it as a script, and execute its contents immediately.
64 read_commandline_script(const char* filename, Command_line*);
66 } // End namespace gold.
68 #endif // !defined(GOLD_SCRIPT_H)