Commit | Line | Data |
---|---|---|
55cb97d8 KR |
1 | cat >em_${EMULATION_NAME}.c <<EOF |
2 | /* An emulation for HP PA-RISC OSF/1 linkers. | |
3 | Copyright (C) 1991 Free Software Foundation, Inc. | |
4 | Written by Steve Chamberlain steve@cygnus.com | |
5 | ||
6 | This file is part of GLD, the Gnu Linker. | |
7 | ||
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 2 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
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. | |
17 | ||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
21 | ||
22 | #include "bfd.h" | |
23 | #include "sysdep.h" | |
24 | ||
25 | ||
26 | #include "ld.h" | |
27 | #include "config.h" | |
28 | #include "ldemul.h" | |
29 | #include "ldfile.h" | |
30 | #include "ldmisc.h" | |
31 | ||
32 | extern boolean lang_float_flag; | |
33 | ||
34 | ||
35 | extern enum bfd_architecture ldfile_output_architecture; | |
36 | extern unsigned long ldfile_output_machine; | |
37 | extern char *ldfile_output_machine_name; | |
38 | ||
39 | extern bfd *output_bfd; | |
40 | ||
41 | ||
42 | #ifdef HPPAOSF | |
43 | ||
44 | static void hppaosf_before_parse() | |
45 | { | |
46 | static char *env_variables[] = { "HPPALIB", "HPPABASE", 0 }; | |
47 | char **p; | |
48 | char *env ; | |
49 | ||
50 | for ( p = env_variables; *p; p++ ){ | |
51 | env = (char *) getenv(*p); | |
52 | if (env) { | |
53 | ldfile_add_library_path(concat(env,"/lib/libbout","")); | |
54 | } | |
55 | } | |
56 | ldfile_output_architecture = bfd_arch_hppa; | |
57 | } | |
58 | #else | |
59 | static void hppaosf_before_parse() | |
60 | { | |
61 | char *env ; | |
62 | env = getenv("HPPALIB"); | |
63 | if (env) { | |
64 | ldfile_add_library_path(env); | |
65 | } | |
66 | env = getenv("HPPABASE"); | |
67 | if (env) { | |
68 | ldfile_add_library_path(concat(env,"/lib","")); | |
69 | } | |
70 | ldfile_output_architecture = bfd_arch_hppa; | |
71 | } | |
72 | #endif /* HPPAOSF */ | |
73 | ||
74 | static void | |
75 | hppaosf_set_output_arch() | |
76 | { | |
77 | /* Set the output architecture and machine if possible */ | |
78 | unsigned long machine = 0; | |
79 | bfd_set_arch_mach(output_bfd, ldfile_output_architecture, machine); | |
80 | } | |
81 | ||
82 | static char *script = | |
83 | #include "hppaosf.x" | |
84 | ; | |
85 | ||
86 | ||
87 | static char *script_reloc = | |
88 | #include "hppaosf.xr" | |
89 | ; | |
90 | ||
91 | ||
92 | static char *hppaosf_get_script() | |
93 | { | |
94 | extern ld_config_type config; | |
95 | if (config.relocateable_output) | |
96 | return script_reloc; | |
97 | return script; | |
98 | ||
99 | } | |
100 | ||
101 | struct ld_emulation_xfer_struct ld_hppaosf_emulation = | |
102 | { | |
103 | hppaosf_before_parse, | |
104 | syslib_default, | |
105 | hll_default, | |
106 | after_parse_default, | |
107 | after_allocation_default, | |
108 | hppaosf_set_output_arch, | |
109 | ldemul_default_target, | |
110 | before_allocation_default, | |
111 | hppaosf_get_script, | |
112 | "hppaosf", | |
113 | "elf-big" | |
114 | }; | |
115 | EOF |