1 |
/* Support for 32-bit SPARC NLM (NetWare Loadable Module) |
/* Support for 32-bit SPARC NLM (NetWare Loadable Module) |
2 |
Copyright 1993, 1994, 2000, 2001, 2002 Free Software Foundation, Inc. |
Copyright 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004, 2005 |
3 |
|
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of BFD, the Binary File Descriptor library. |
This file is part of BFD, the Binary File Descriptor library. |
6 |
|
|
29 |
|
|
30 |
#include "libnlm.h" |
#include "libnlm.h" |
31 |
|
|
32 |
static boolean nlm_sparc_read_reloc |
static bfd_boolean nlm_sparc_read_reloc |
33 |
PARAMS ((bfd *, nlmNAME(symbol_type) *, asection **, arelent *)); |
PARAMS ((bfd *, nlmNAME(symbol_type) *, asection **, arelent *)); |
34 |
static boolean nlm_sparc_write_reloc |
static bfd_boolean nlm_sparc_write_reloc |
35 |
PARAMS ((bfd *, asection *, arelent *)); |
PARAMS ((bfd *, asection *, arelent *)); |
36 |
static boolean nlm_sparc_mangle_relocs |
static bfd_boolean nlm_sparc_mangle_relocs |
37 |
PARAMS ((bfd *, asection *, PTR, bfd_vma, bfd_size_type)); |
PARAMS ((bfd *, asection *, const PTR, bfd_vma, bfd_size_type)); |
38 |
static boolean nlm_sparc_read_import |
static bfd_boolean nlm_sparc_read_import |
39 |
PARAMS ((bfd *, nlmNAME(symbol_type) *)); |
PARAMS ((bfd *, nlmNAME(symbol_type) *)); |
40 |
static boolean nlm_sparc_write_import |
static bfd_boolean nlm_sparc_write_import |
41 |
PARAMS ((bfd *, asection *, arelent *)); |
PARAMS ((bfd *, asection *, arelent *)); |
42 |
static boolean nlm_sparc_write_external |
static bfd_boolean nlm_sparc_write_external |
43 |
PARAMS ((bfd *, bfd_size_type, asymbol *, struct reloc_and_sec *)); |
PARAMS ((bfd *, bfd_size_type, asymbol *, struct reloc_and_sec *)); |
44 |
static boolean nlm_sparc_write_export |
static bfd_boolean nlm_sparc_write_export |
45 |
PARAMS ((bfd *, asymbol *, bfd_vma)); |
PARAMS ((bfd *, asymbol *, bfd_vma)); |
46 |
|
|
47 |
enum reloc_type |
enum reloc_type |
62 |
R_SPARC_max |
R_SPARC_max |
63 |
}; |
}; |
64 |
|
|
|
#if 0 |
|
|
static const char *const reloc_type_names[] = |
|
|
{ |
|
|
"R_SPARC_NONE", |
|
|
"R_SPARC_8", "R_SPARC_16", "R_SPARC_32", |
|
|
"R_SPARC_DISP8", "R_SPARC_DISP16", "R_SPARC_DISP32", |
|
|
"R_SPARC_WDISP30", "R_SPARC_WDISP22", |
|
|
"R_SPARC_HI22", "R_SPARC_22", |
|
|
"R_SPARC_13", "R_SPARC_LO10", |
|
|
"R_SPARC_GOT10", "R_SPARC_GOT13", "R_SPARC_GOT22", |
|
|
"R_SPARC_PC10", "R_SPARC_PC22", |
|
|
"R_SPARC_WPLT30", |
|
|
"R_SPARC_COPY", |
|
|
"R_SPARC_GLOB_DAT", "R_SPARC_JMP_SLOT", |
|
|
"R_SPARC_RELATIVE", |
|
|
"R_SPARC_UA32", |
|
|
}; |
|
|
#endif |
|
|
|
|
65 |
static reloc_howto_type nlm32_sparc_howto_table[] = |
static reloc_howto_type nlm32_sparc_howto_table[] = |
66 |
{ |
{ |
67 |
HOWTO (R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, 0,"R_SPARC_NONE", false,0,0x00000000,true), |
HOWTO (R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, 0,"R_SPARC_NONE", FALSE,0,0x00000000,TRUE), |
68 |
HOWTO (R_SPARC_8, 0,0, 8,false,0,complain_overflow_bitfield,0,"R_SPARC_8", false,0,0x000000ff,true), |
HOWTO (R_SPARC_8, 0,0, 8,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_8", FALSE,0,0x000000ff,TRUE), |
69 |
HOWTO (R_SPARC_16, 0,1,16,false,0,complain_overflow_bitfield,0,"R_SPARC_16", false,0,0x0000ffff,true), |
HOWTO (R_SPARC_16, 0,1,16,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_16", FALSE,0,0x0000ffff,TRUE), |
70 |
HOWTO (R_SPARC_32, 0,2,32,false,0,complain_overflow_bitfield,0,"R_SPARC_32", false,0,0xffffffff,true), |
HOWTO (R_SPARC_32, 0,2,32,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_32", FALSE,0,0xffffffff,TRUE), |
71 |
HOWTO (R_SPARC_DISP8, 0,0, 8,true, 0,complain_overflow_signed, 0,"R_SPARC_DISP8", false,0,0x000000ff,true), |
HOWTO (R_SPARC_DISP8, 0,0, 8,TRUE, 0,complain_overflow_signed, 0,"R_SPARC_DISP8", FALSE,0,0x000000ff,TRUE), |
72 |
HOWTO (R_SPARC_DISP16, 0,1,16,true, 0,complain_overflow_signed, 0,"R_SPARC_DISP16", false,0,0x0000ffff,true), |
HOWTO (R_SPARC_DISP16, 0,1,16,TRUE, 0,complain_overflow_signed, 0,"R_SPARC_DISP16", FALSE,0,0x0000ffff,TRUE), |
73 |
HOWTO (R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, 0,"R_SPARC_DISP32", false,0,0x00ffffff,true), |
HOWTO (R_SPARC_DISP32, 0,2,32,TRUE, 0,complain_overflow_signed, 0,"R_SPARC_DISP32", FALSE,0,0x00ffffff,TRUE), |
74 |
HOWTO (R_SPARC_WDISP30, 2,2,30,true, 0,complain_overflow_signed, 0,"R_SPARC_WDISP30", false,0,0x3fffffff,true), |
HOWTO (R_SPARC_WDISP30, 2,2,30,TRUE, 0,complain_overflow_signed, 0,"R_SPARC_WDISP30", FALSE,0,0x3fffffff,TRUE), |
75 |
HOWTO (R_SPARC_WDISP22, 2,2,22,true, 0,complain_overflow_signed, 0,"R_SPARC_WDISP22", false,0,0x003fffff,true), |
HOWTO (R_SPARC_WDISP22, 2,2,22,TRUE, 0,complain_overflow_signed, 0,"R_SPARC_WDISP22", FALSE,0,0x003fffff,TRUE), |
76 |
HOWTO (R_SPARC_HI22, 10,2,22,false,0,complain_overflow_dont, 0,"R_SPARC_HI22", false,0,0x003fffff,true), |
HOWTO (R_SPARC_HI22, 10,2,22,FALSE,0,complain_overflow_dont, 0,"R_SPARC_HI22", FALSE,0,0x003fffff,TRUE), |
77 |
HOWTO (R_SPARC_22, 0,2,22,false,0,complain_overflow_bitfield,0,"R_SPARC_22", false,0,0x003fffff,true), |
HOWTO (R_SPARC_22, 0,2,22,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_22", FALSE,0,0x003fffff,TRUE), |
78 |
HOWTO (R_SPARC_13, 0,2,13,false,0,complain_overflow_bitfield,0,"R_SPARC_13", false,0,0x00001fff,true), |
HOWTO (R_SPARC_13, 0,2,13,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_13", FALSE,0,0x00001fff,TRUE), |
79 |
HOWTO (R_SPARC_LO10, 0,2,10,false,0,complain_overflow_dont, 0,"R_SPARC_LO10", false,0,0x000003ff,true), |
HOWTO (R_SPARC_LO10, 0,2,10,FALSE,0,complain_overflow_dont, 0,"R_SPARC_LO10", FALSE,0,0x000003ff,TRUE), |
80 |
HOWTO (R_SPARC_GOT10, 0,2,10,false,0,complain_overflow_bitfield,0,"R_SPARC_GOT10", false,0,0x000003ff,true), |
HOWTO (R_SPARC_GOT10, 0,2,10,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_GOT10", FALSE,0,0x000003ff,TRUE), |
81 |
HOWTO (R_SPARC_GOT13, 0,2,13,false,0,complain_overflow_bitfield,0,"R_SPARC_GOT13", false,0,0x00001fff,true), |
HOWTO (R_SPARC_GOT13, 0,2,13,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_GOT13", FALSE,0,0x00001fff,TRUE), |
82 |
HOWTO (R_SPARC_GOT22, 10,2,22,false,0,complain_overflow_bitfield,0,"R_SPARC_GOT22", false,0,0x003fffff,true), |
HOWTO (R_SPARC_GOT22, 10,2,22,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_GOT22", FALSE,0,0x003fffff,TRUE), |
83 |
HOWTO (R_SPARC_PC10, 0,2,10,false,0,complain_overflow_bitfield,0,"R_SPARC_PC10", false,0,0x000003ff,true), |
HOWTO (R_SPARC_PC10, 0,2,10,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_PC10", FALSE,0,0x000003ff,TRUE), |
84 |
HOWTO (R_SPARC_PC22, 0,2,22,false,0,complain_overflow_bitfield,0,"R_SPARC_PC22", false,0,0x003fffff,true), |
HOWTO (R_SPARC_PC22, 0,2,22,FALSE,0,complain_overflow_bitfield,0,"R_SPARC_PC22", FALSE,0,0x003fffff,TRUE), |
85 |
HOWTO (R_SPARC_WPLT30, 0,0,00,false,0,complain_overflow_dont, 0,"R_SPARC_WPLT30", false,0,0x00000000,true), |
HOWTO (R_SPARC_WPLT30, 0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_WPLT30", FALSE,0,0x00000000,TRUE), |
86 |
HOWTO (R_SPARC_COPY, 0,0,00,false,0,complain_overflow_dont, 0,"R_SPARC_COPY", false,0,0x00000000,true), |
HOWTO (R_SPARC_COPY, 0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_COPY", FALSE,0,0x00000000,TRUE), |
87 |
HOWTO (R_SPARC_GLOB_DAT,0,0,00,false,0,complain_overflow_dont, 0,"R_SPARC_GLOB_DAT",false,0,0x00000000,true), |
HOWTO (R_SPARC_GLOB_DAT,0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_GLOB_DAT",FALSE,0,0x00000000,TRUE), |
88 |
HOWTO (R_SPARC_JMP_SLOT,0,0,00,false,0,complain_overflow_dont, 0,"R_SPARC_JMP_SLOT",false,0,0x00000000,true), |
HOWTO (R_SPARC_JMP_SLOT,0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_JMP_SLOT",FALSE,0,0x00000000,TRUE), |
89 |
HOWTO (R_SPARC_RELATIVE,0,0,00,false,0,complain_overflow_dont, 0,"R_SPARC_RELATIVE",false,0,0x00000000,true), |
HOWTO (R_SPARC_RELATIVE,0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_RELATIVE",FALSE,0,0x00000000,TRUE), |
90 |
HOWTO (R_SPARC_UA32, 0,0,00,false,0,complain_overflow_dont, 0,"R_SPARC_UA32", false,0,0x00000000,true), |
HOWTO (R_SPARC_UA32, 0,0,00,FALSE,0,complain_overflow_dont, 0,"R_SPARC_UA32", FALSE,0,0x00000000,TRUE), |
91 |
}; |
}; |
92 |
|
|
93 |
/* Read a NetWare sparc reloc. */ |
/* Read a NetWare sparc reloc. */ |
100 |
unsigned char pad1[3]; |
unsigned char pad1[3]; |
101 |
}; |
}; |
102 |
|
|
103 |
static boolean |
static bfd_boolean |
104 |
nlm_sparc_read_reloc (abfd, sym, secp, rel) |
nlm_sparc_read_reloc (abfd, sym, secp, rel) |
105 |
bfd *abfd; |
bfd *abfd; |
106 |
nlmNAME(symbol_type) *sym ATTRIBUTE_UNUSED; |
nlmNAME(symbol_type) *sym ATTRIBUTE_UNUSED; |
114 |
asection *code_sec, *data_sec; |
asection *code_sec, *data_sec; |
115 |
|
|
116 |
if (bfd_bread (&tmp_reloc, (bfd_size_type) 12, abfd) != 12) |
if (bfd_bread (&tmp_reloc, (bfd_size_type) 12, abfd) != 12) |
117 |
return false; |
return FALSE; |
118 |
|
|
119 |
code_sec = bfd_get_section_by_name (abfd, NLM_CODE_NAME); |
code_sec = bfd_get_section_by_name (abfd, NLM_CODE_NAME); |
120 |
data_sec = bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME); |
data_sec = bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME); |
142 |
fprintf (stderr, "%s: address = %08lx, addend = %08lx, type = %d, howto = %08lx\n", |
fprintf (stderr, "%s: address = %08lx, addend = %08lx, type = %d, howto = %08lx\n", |
143 |
__FUNCTION__, rel->address, rel->addend, type, rel->howto); |
__FUNCTION__, rel->address, rel->addend, type, rel->howto); |
144 |
#endif |
#endif |
145 |
return true; |
return TRUE; |
146 |
|
|
147 |
} |
} |
148 |
|
|
149 |
/* Write a NetWare sparc reloc. */ |
/* Write a NetWare sparc reloc. */ |
150 |
|
|
151 |
static boolean |
static bfd_boolean |
152 |
nlm_sparc_write_reloc (abfd, sec, rel) |
nlm_sparc_write_reloc (abfd, sec, rel) |
153 |
bfd *abfd; |
bfd *abfd; |
154 |
asection *sec; |
asection *sec; |
192 |
segment. This offset is the section vma, adjusted by the vma of |
segment. This offset is the section vma, adjusted by the vma of |
193 |
the lowest section in that segment, plus the address of the |
the lowest section in that segment, plus the address of the |
194 |
relocation. */ |
relocation. */ |
|
#if 0 |
|
|
val = bfd_get_section_vma (abfd, (*rel->sym_ptr_ptr)->section) + rel->address; |
|
|
#else |
|
195 |
val = bfd_get_section_vma (abfd, sec) + rel->address; |
val = bfd_get_section_vma (abfd, sec) + rel->address; |
|
#endif |
|
196 |
|
|
197 |
#ifdef DEBUG |
#ifdef DEBUG |
198 |
fprintf (stderr, "%s: val = %08lx, addend = %08lx, type = %d\n", |
fprintf (stderr, "%s: val = %08lx, addend = %08lx, type = %d\n", |
203 |
bfd_put_8 (abfd, (short) (rel->howto->type), tmp_reloc.type); |
bfd_put_8 (abfd, (short) (rel->howto->type), tmp_reloc.type); |
204 |
|
|
205 |
if (bfd_bwrite (&tmp_reloc, (bfd_size_type) 12, abfd) != 12) |
if (bfd_bwrite (&tmp_reloc, (bfd_size_type) 12, abfd) != 12) |
206 |
return false; |
return FALSE; |
207 |
|
|
208 |
return true; |
return TRUE; |
209 |
} |
} |
210 |
|
|
211 |
/* Mangle relocs for SPARC NetWare. We can just use the standard |
/* Mangle relocs for SPARC NetWare. We can just use the standard |
212 |
SPARC relocs. */ |
SPARC relocs. */ |
213 |
|
|
214 |
static boolean |
static bfd_boolean |
215 |
nlm_sparc_mangle_relocs (abfd, sec, data, offset, count) |
nlm_sparc_mangle_relocs (abfd, sec, data, offset, count) |
216 |
bfd *abfd ATTRIBUTE_UNUSED; |
bfd *abfd ATTRIBUTE_UNUSED; |
217 |
asection *sec ATTRIBUTE_UNUSED; |
asection *sec ATTRIBUTE_UNUSED; |
218 |
PTR data ATTRIBUTE_UNUSED; |
const PTR data ATTRIBUTE_UNUSED; |
219 |
bfd_vma offset ATTRIBUTE_UNUSED; |
bfd_vma offset ATTRIBUTE_UNUSED; |
220 |
bfd_size_type count ATTRIBUTE_UNUSED; |
bfd_size_type count ATTRIBUTE_UNUSED; |
221 |
{ |
{ |
222 |
return true; |
return TRUE; |
223 |
} |
} |
224 |
|
|
225 |
/* Read a NetWare sparc import record. */ |
/* Read a NetWare sparc import record. */ |
226 |
|
|
227 |
static boolean |
static bfd_boolean |
228 |
nlm_sparc_read_import (abfd, sym) |
nlm_sparc_read_import (abfd, sym) |
229 |
bfd *abfd; |
bfd *abfd; |
230 |
nlmNAME(symbol_type) *sym; |
nlmNAME(symbol_type) *sym; |
238 |
/* First, read in the number of relocation |
/* First, read in the number of relocation |
239 |
entries for this symbol. */ |
entries for this symbol. */ |
240 |
if (bfd_bread ((PTR) temp, (bfd_size_type) 4, abfd) != 4) |
if (bfd_bread ((PTR) temp, (bfd_size_type) 4, abfd) != 4) |
241 |
return false; |
return FALSE; |
242 |
|
|
243 |
rcount = bfd_get_32 (abfd, temp); |
rcount = bfd_get_32 (abfd, temp); |
244 |
|
|
246 |
|
|
247 |
if (bfd_bread ((PTR) &symlength, (bfd_size_type) sizeof (symlength), abfd) |
if (bfd_bread ((PTR) &symlength, (bfd_size_type) sizeof (symlength), abfd) |
248 |
!= sizeof (symlength)) |
!= sizeof (symlength)) |
249 |
return false; |
return FALSE; |
250 |
sym -> symbol.the_bfd = abfd; |
sym -> symbol.the_bfd = abfd; |
251 |
name = bfd_alloc (abfd, (bfd_size_type) symlength + 1); |
name = bfd_alloc (abfd, (bfd_size_type) symlength + 1); |
252 |
if (name == NULL) |
if (name == NULL) |
253 |
return false; |
return FALSE; |
254 |
|
|
255 |
/* Then read in the symbol. */ |
/* Then read in the symbol. */ |
256 |
|
|
257 |
if (bfd_bread (name, (bfd_size_type) symlength, abfd) != symlength) |
if (bfd_bread (name, (bfd_size_type) symlength, abfd) != symlength) |
258 |
return false; |
return FALSE; |
259 |
name[symlength] = '\0'; |
name[symlength] = '\0'; |
260 |
sym -> symbol.name = name; |
sym -> symbol.name = name; |
261 |
sym -> symbol.flags = 0; |
sym -> symbol.flags = 0; |
267 |
nlm_relocs = ((struct nlm_relent *) |
nlm_relocs = ((struct nlm_relent *) |
268 |
bfd_alloc (abfd, rcount * sizeof (struct nlm_relent))); |
bfd_alloc (abfd, rcount * sizeof (struct nlm_relent))); |
269 |
if (!nlm_relocs) |
if (!nlm_relocs) |
270 |
return false; |
return FALSE; |
271 |
sym -> relocs = nlm_relocs; |
sym -> relocs = nlm_relocs; |
272 |
sym -> rcnt = 0; |
sym -> rcnt = 0; |
273 |
while (sym -> rcnt < rcount) |
while (sym -> rcnt < rcount) |
275 |
asection *section; |
asection *section; |
276 |
|
|
277 |
if (! nlm_sparc_read_reloc (abfd, sym, §ion, &nlm_relocs -> reloc)) |
if (! nlm_sparc_read_reloc (abfd, sym, §ion, &nlm_relocs -> reloc)) |
278 |
return false; |
return FALSE; |
279 |
nlm_relocs -> section = section; |
nlm_relocs -> section = section; |
280 |
nlm_relocs++; |
nlm_relocs++; |
281 |
sym -> rcnt++; |
sym -> rcnt++; |
282 |
} |
} |
283 |
|
|
284 |
return true; |
return TRUE; |
285 |
} |
} |
286 |
|
|
287 |
static boolean |
static bfd_boolean |
288 |
nlm_sparc_write_import (abfd, sec, rel) |
nlm_sparc_write_import (abfd, sec, rel) |
289 |
bfd *abfd; |
bfd *abfd; |
290 |
asection *sec; |
asection *sec; |
302 |
if (symsec == code) |
if (symsec == code) |
303 |
base = 0; |
base = 0; |
304 |
else if (symsec == data) |
else if (symsec == data) |
305 |
base = bfd_section_size (abfd, code); |
base = code->size; |
306 |
else if (symsec == bss) |
else if (symsec == bss) |
307 |
base = bfd_section_size (abfd, code) + bfd_section_size (abfd, data); |
base = code->size + data->size; |
308 |
else |
else |
309 |
base = 0; |
base = 0; |
310 |
|
|
314 |
#endif |
#endif |
315 |
bfd_put_32 (abfd, base + (*rel->sym_ptr_ptr)->value, temp); |
bfd_put_32 (abfd, base + (*rel->sym_ptr_ptr)->value, temp); |
316 |
if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4) |
if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4) |
317 |
return false; |
return FALSE; |
318 |
bfd_put_32 (abfd, (bfd_vma) 1, temp); |
bfd_put_32 (abfd, (bfd_vma) 1, temp); |
319 |
if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4) |
if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4) |
320 |
return false; |
return FALSE; |
321 |
if (! nlm_sparc_write_reloc (abfd, sec, rel)) |
if (! nlm_sparc_write_reloc (abfd, sec, rel)) |
322 |
return false; |
return FALSE; |
323 |
return true; |
return TRUE; |
324 |
} |
} |
325 |
|
|
326 |
/* Write out an external reference. */ |
/* Write out an external reference. */ |
327 |
|
|
328 |
static boolean |
static bfd_boolean |
329 |
nlm_sparc_write_external (abfd, count, sym, relocs) |
nlm_sparc_write_external (abfd, count, sym, relocs) |
330 |
bfd *abfd; |
bfd *abfd; |
331 |
bfd_size_type count; |
bfd_size_type count; |
338 |
|
|
339 |
bfd_put_32 (abfd, count, temp); |
bfd_put_32 (abfd, count, temp); |
340 |
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp)) |
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), abfd) != sizeof (temp)) |
341 |
return false; |
return FALSE; |
342 |
|
|
343 |
len = strlen (sym->name); |
len = strlen (sym->name); |
344 |
if ((bfd_bwrite (&len, (bfd_size_type) sizeof (bfd_byte), abfd) |
if ((bfd_bwrite (&len, (bfd_size_type) sizeof (bfd_byte), abfd) |
345 |
!= sizeof (bfd_byte)) |
!= sizeof (bfd_byte)) |
346 |
|| bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len) |
|| bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len) |
347 |
return false; |
return FALSE; |
348 |
|
|
349 |
for (i = 0; i < count; i++) |
for (i = 0; i < count; i++) |
350 |
{ |
{ |
351 |
if (! nlm_sparc_write_reloc (abfd, relocs[i].sec, relocs[i].rel)) |
if (! nlm_sparc_write_reloc (abfd, relocs[i].sec, relocs[i].rel)) |
352 |
return false; |
return FALSE; |
353 |
} |
} |
354 |
|
|
355 |
return true; |
return TRUE; |
356 |
} |
} |
357 |
|
|
358 |
static boolean |
static bfd_boolean |
359 |
nlm_sparc_write_export (abfd, sym, value) |
nlm_sparc_write_export (abfd, sym, value) |
360 |
bfd *abfd; |
bfd *abfd; |
361 |
asymbol *sym; |
asymbol *sym; |
374 |
if (bfd_bwrite (temp, (bfd_size_type) 4, abfd) != 4 |
if (bfd_bwrite (temp, (bfd_size_type) 4, abfd) != 4 |
375 |
|| bfd_bwrite (&len, (bfd_size_type) 1, abfd) != 1 |
|| bfd_bwrite (&len, (bfd_size_type) 1, abfd) != 1 |
376 |
|| bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len) |
|| bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len) |
377 |
return false; |
return FALSE; |
378 |
|
|
379 |
return true; |
return TRUE; |
380 |
} |
} |
381 |
|
|
382 |
#undef nlm_swap_fixed_header_in |
#undef nlm_swap_fixed_header_in |
391 |
0, /* optional_prefix_size */ |
0, /* optional_prefix_size */ |
392 |
bfd_arch_sparc, |
bfd_arch_sparc, |
393 |
0, |
0, |
394 |
false, |
FALSE, |
395 |
0, /* backend_object_p */ |
0, /* backend_object_p */ |
396 |
0, /* write_prefix_func */ |
0, /* write_prefix_func */ |
397 |
nlm_sparc_read_reloc, |
nlm_sparc_read_reloc, |