1 /* BFD back-end for Apple M68K COFF A/UX 3.x files.
2 Copyright (C) 1996-2014 Free Software Foundation, Inc.
3 Written by Richard Henderson <rth@tamu.edu>.
5 This file is part of BFD, the Binary File Descriptor library.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
22 #define TARGET_SYM m68k_coff_aux_vec
23 #define TARGET_NAME "coff-m68k-aux"
29 #define COFF_LONG_FILENAMES
32 #define COFF_PAGE_SIZE 0x1000
34 /* On AUX, a STYP_NOLOAD|STYP_BSS section is part of a shared library. */
35 #define BSS_NOLOAD_IS_SHARED_LIBRARY
39 #define COFF_COMMON_ADDEND
44 #define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol
46 coff_m68k_aux_link_add_one_symbol
47 (struct bfd_link_info
*, bfd
*, const char *, flagword
, asection
*,
48 bfd_vma
, const char *, bfd_boolean
, bfd_boolean
,
49 struct bfd_link_hash_entry
**);
51 #ifndef bfd_pe_print_pdata
52 #define bfd_pe_print_pdata NULL
55 #include "coff/aux-coff.h" /* override coff/internal.h and coff/m68k.h */
56 #include "coff-m68k.c"
58 /* We need non-absolute symbols to override absolute symbols. This
59 mirrors Apple's "solution" to let a static library symbol override
60 a shared library symbol. On the whole not a good thing, given how
61 shared libraries work here, but can work if you are careful with
62 what you include in the shared object. */
65 coff_m68k_aux_link_add_one_symbol (struct bfd_link_info
*info
,
74 struct bfd_link_hash_entry
**hashp
)
76 struct bfd_link_hash_entry
*h
;
78 if ((flags
& (BSF_WARNING
| BSF_CONSTRUCTOR
| BSF_WEAK
)) == 0 &&
79 !bfd_is_und_section (section
) &&
80 !bfd_is_com_section (section
))
82 /* The new symbol is a definition or an indirect definition */
84 /* This bit copied from linker.c */
85 if (hashp
!= NULL
&& *hashp
!= NULL
)
88 BFD_ASSERT (strcmp (h
->root
.string
, name
) == 0);
92 h
= bfd_link_hash_lookup (info
->hash
, name
, TRUE
, copy
, FALSE
);
101 if (info
->notice_hash
!= (struct bfd_hash_table
*) NULL
102 && (bfd_hash_lookup (info
->notice_hash
, name
, FALSE
, FALSE
)
103 != (struct bfd_hash_entry
*) NULL
))
105 if (! (*info
->callbacks
->notice
) (info
, h
, abfd
, section
, value
,
110 if (hashp
!= (struct bfd_link_hash_entry
**) NULL
)
112 /* end duplication from linker.c */
114 if (h
->type
== bfd_link_hash_defined
115 || h
->type
== bfd_link_hash_indirect
)
119 if (h
->type
== bfd_link_hash_defined
)
120 msec
= h
->u
.def
.section
;
122 msec
= bfd_ind_section_ptr
;
124 if (bfd_is_abs_section (msec
) && !bfd_is_abs_section (section
))
126 h
->u
.def
.section
= section
;
127 h
->u
.def
.value
= value
;
130 else if (bfd_is_abs_section (section
) && !bfd_is_abs_section (msec
))
135 /* If we didn't exit early, finish processing in the generic routine */
136 return _bfd_generic_link_add_one_symbol (info
, abfd
, name
, flags
, section
,
137 value
, string
, copy
, collect
,