More resonable default.
[deliverable/binutils-gdb.git] / ld / hppaosf.em
CommitLineData
55cb97d8
KR
1cat >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
6This file is part of GLD, the Gnu Linker.
7
8This program is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program; if not, write to the Free Software
20Foundation, 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
32extern boolean lang_float_flag;
33
34
35extern enum bfd_architecture ldfile_output_architecture;
36extern unsigned long ldfile_output_machine;
37extern char *ldfile_output_machine_name;
38
39extern bfd *output_bfd;
40
41
42#ifdef HPPAOSF
43
44static 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
59static 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
74static void
75hppaosf_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
82static char *script =
83#include "hppaosf.x"
84;
85
86
87static char *script_reloc =
88#include "hppaosf.xr"
89 ;
90
91
92static 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
101struct 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};
115EOF
This page took 0.025929 seconds and 4 git commands to generate.