1 /* Motorola 68k series support for 32-bit ELF
2 Copyright 1993 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 static reloc_howto_type
*reloc_type_lookup
27 PARAMS ((bfd
*, bfd_reloc_code_real_type
));
28 static void rtype_to_howto
29 PARAMS ((bfd
*, arelent
*, Elf32_Internal_Rela
*));
30 static void rtype_to_howto_rel
31 PARAMS ((bfd
*, arelent
*, Elf32_Internal_Rel
*));
32 static boolean elf_m68k_check_relocs
33 PARAMS ((bfd
*, struct bfd_link_info
*, asection
*,
34 const Elf_Internal_Rela
*));
35 static boolean elf_m68k_adjust_dynamic_symbol
36 PARAMS ((struct bfd_link_info
*, struct elf_link_hash_entry
*));
37 static boolean elf_m68k_size_dynamic_sections
38 PARAMS ((bfd
*, struct bfd_link_info
*));
39 static boolean elf_m68k_relocate_section
40 PARAMS ((bfd
*, struct bfd_link_info
*, bfd
*, asection
*, bfd_byte
*,
41 Elf_Internal_Rela
*, Elf_Internal_Sym
*, asection
**));
42 static boolean elf_m68k_finish_dynamic_symbol
43 PARAMS ((bfd
*, struct bfd_link_info
*, struct elf_link_hash_entry
*,
45 static boolean elf_m68k_finish_dynamic_sections
46 PARAMS ((bfd
*, struct bfd_link_info
*));
48 /* elf32 m68k code, generated by elf.el */
76 static reloc_howto_type howto_table
[] = {
77 HOWTO(R_68K_NONE
, 0, 0, 0, false,0, complain_overflow_dont
, bfd_elf_generic_reloc
, "R_68K_NONE", false, 0, 0x00000000,false),
78 HOWTO(R_68K_32
, 0, 2,32, false,0, complain_overflow_bitfield
, bfd_elf_generic_reloc
, "R_68K_32", false, 0, 0xffffffff,false),
79 HOWTO(R_68K_16
, 0, 1,16, false,0, complain_overflow_bitfield
, bfd_elf_generic_reloc
, "R_68K_16", false, 0, 0x0000ffff,false),
80 HOWTO(R_68K_8
, 0, 0, 8, false,0, complain_overflow_bitfield
, bfd_elf_generic_reloc
, "R_68K_8", false, 0, 0x000000ff,false),
81 HOWTO(R_68K_PC32
, 0, 2,32, true, 0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_PC32", false, 0, 0xffffffff,true),
82 HOWTO(R_68K_PC16
, 0, 1,16, true, 0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_PC16", false, 0, 0x0000ffff,true),
83 HOWTO(R_68K_PC8
, 0, 0, 8, true, 0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_PC8", false, 0, 0x000000ff,true),
84 HOWTO(R_68K_GOT32
, 0, 2,32, true, 0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_GOT32", false, 0, 0xffffffff,true),
85 HOWTO(R_68K_GOT16
, 0, 1,16, true, 0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_GOT16", false, 0, 0x0000ffff,true),
86 HOWTO(R_68K_GOT8
, 0, 0, 8, true, 0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_GOT8", false, 0, 0x000000ff,true),
87 HOWTO(R_68K_GOT32O
, 0, 2,32, false,0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_GOT32O", false, 0, 0xffffffff,false),
88 HOWTO(R_68K_GOT16O
, 0, 1,16, false,0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_GOT16O", false, 0, 0x0000ffff,false),
89 HOWTO(R_68K_GOT8O
, 0, 0, 8, false,0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_GOT8O", false, 0, 0x000000ff,false),
90 HOWTO(R_68K_PLT32
, 0, 2,32, true, 0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_PLT32", false, 0, 0xffffffff,true),
91 HOWTO(R_68K_PLT16
, 0, 1,16, true, 0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_PLT16", false, 0, 0x0000ffff,true),
92 HOWTO(R_68K_PLT8
, 0, 0, 8, true, 0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_PLT8", false, 0, 0x000000ff,true),
93 HOWTO(R_68K_PLT32O
, 0, 2,32, false,0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_PLT32O", false, 0, 0xffffffff,false),
94 HOWTO(R_68K_PLT16O
, 0, 1,16, false,0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_PLT16O", false, 0, 0x0000ffff,false),
95 HOWTO(R_68K_PLT8O
, 0, 0, 8, false,0, complain_overflow_signed
, bfd_elf_generic_reloc
, "R_68K_PLT8O", false, 0, 0x000000ff,false),
96 HOWTO(R_68K_COPY
, 0, 0, 0, false,0, complain_overflow_dont
, bfd_elf_generic_reloc
, "R_68K_COPY", false, 0, 0xffffffff,false),
97 HOWTO(R_68K_GLOB_DAT
, 0, 2,32, false,0, complain_overflow_dont
, bfd_elf_generic_reloc
, "R_68K_GLOB_DAT", false, 0, 0xffffffff,false),
98 HOWTO(R_68K_JMP_SLOT
, 0, 2,32, false,0, complain_overflow_dont
, bfd_elf_generic_reloc
, "R_68K_JMP_SLOT", false, 0, 0xffffffff,false),
99 HOWTO(R_68K_RELATIVE
, 0, 2,32, false,0, complain_overflow_dont
, bfd_elf_generic_reloc
, "R_68K_RELATIVE", false, 0, 0xffffffff,false),
103 rtype_to_howto (abfd
, cache_ptr
, dst
)
106 Elf_Internal_Rela
*dst
;
108 BFD_ASSERT (ELF32_R_TYPE(dst
->r_info
) < (unsigned int) R_68K__max
);
109 cache_ptr
->howto
= &howto_table
[ELF32_R_TYPE(dst
->r_info
)];
113 rtype_to_howto_rel (abfd
, cache_ptr
, dst
)
116 Elf_Internal_Rel
*dst
;
118 BFD_ASSERT (ELF32_R_TYPE(dst
->r_info
) < (unsigned int) R_68K__max
);
119 cache_ptr
->howto
= &howto_table
[ELF32_R_TYPE(dst
->r_info
)];
122 #define elf_info_to_howto rtype_to_howto
123 #define elf_info_to_howto_rel rtype_to_howto_rel
125 static const struct { unsigned char bfd_val
, elf_val
; } reloc_map
[] = {
126 { BFD_RELOC_NONE
, R_68K_NONE
},
127 { BFD_RELOC_32
, R_68K_32
},
128 { BFD_RELOC_16
, R_68K_16
},
129 { BFD_RELOC_8
, R_68K_8
},
130 { BFD_RELOC_32_PCREL
, R_68K_PC32
},
131 { BFD_RELOC_16_PCREL
, R_68K_PC16
},
132 { BFD_RELOC_8_PCREL
, R_68K_PC8
},
133 { BFD_RELOC_32_GOT_PCREL
, R_68K_GOT32
},
134 { BFD_RELOC_16_GOT_PCREL
, R_68K_GOT16
},
135 { BFD_RELOC_8_GOT_PCREL
, R_68K_GOT8
},
136 { BFD_RELOC_32_GOTOFF
, R_68K_GOT32O
},
137 { BFD_RELOC_16_GOTOFF
, R_68K_GOT16O
},
138 { BFD_RELOC_8_GOTOFF
, R_68K_GOT8O
},
139 { BFD_RELOC_32_PLT_PCREL
, R_68K_PLT32
},
140 { BFD_RELOC_16_PLT_PCREL
, R_68K_PLT16
},
141 { BFD_RELOC_8_PLT_PCREL
, R_68K_PLT8
},
142 { BFD_RELOC_32_PLTOFF
, R_68K_PLT32O
},
143 { BFD_RELOC_16_PLTOFF
, R_68K_PLT16O
},
144 { BFD_RELOC_8_PLTOFF
, R_68K_PLT8O
},
145 { BFD_RELOC_NONE
, R_68K_COPY
},
146 { BFD_RELOC_68K_GLOB_DAT
, R_68K_GLOB_DAT
},
147 { BFD_RELOC_68K_JMP_SLOT
, R_68K_JMP_SLOT
},
148 { BFD_RELOC_68K_RELATIVE
, R_68K_RELATIVE
},
149 { BFD_RELOC_CTOR
, R_68K_32
},
152 static reloc_howto_type
*
153 reloc_type_lookup (abfd
, code
)
155 bfd_reloc_code_real_type code
;
158 for (i
= 0; i
< sizeof (reloc_map
) / sizeof (reloc_map
[0]); i
++)
160 if (reloc_map
[i
].bfd_val
== code
)
161 return &howto_table
[(int) reloc_map
[i
].elf_val
];
166 #define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup
167 #define ELF_ARCH bfd_arch_m68k
168 /* end code generated by elf.el */
173 /* Functions for the m68k ELF linker. */
175 /* The name of the dynamic interpreter. This is put in the .interp
178 #define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
180 /* The size in bytes of an entry in the procedure linkage table. */
182 #define PLT_ENTRY_SIZE 20
184 /* The first entry in a procedure linkage table looks like this. See
185 the SVR4 ABI m68k supplement to see how this works. */
187 static const bfd_byte elf_m68k_plt0_entry
[PLT_ENTRY_SIZE
] =
189 0x2f, 0x3b, 0x01, 0x70, /* move.l (%pc,addr),-(%sp) */
190 0, 0, 0, 0, /* replaced with address of .got + 4. */
191 0x4e, 0xfb, 0x01, 0x71, /* jmp ([%pc,addr]) */
192 0, 0, 0, 0, /* replaced with address of .got + 8. */
193 0, 0, 0, 0 /* pad out to 20 bytes. */
196 /* Subsequent entries in a procedure linkage table look like this. */
198 static const bfd_byte elf_m68k_plt_entry
[PLT_ENTRY_SIZE
] =
200 0x4e, 0xfb, 0x01, 0x71, /* jmp ([addr]) */
201 0, 0, 0, 0, /* replaced with address of this symbol in .got. */
202 0x2f, 0x3c, /* move.l #offset,-(%sp) */
203 0, 0, 0, 0, /* replaced with offset into relocation table. */
204 0x60, 0xff, /* bra.l .plt */
205 0, 0, 0, 0 /* replaced with offset to start of .plt. */
208 /* Look through the relocs for a section during the first phase, and
209 allocate space in the global offset table or procedure linkage
213 elf_m68k_check_relocs (abfd
, info
, sec
, relocs
)
215 struct bfd_link_info
*info
;
217 const Elf_Internal_Rela
*relocs
;
220 Elf_Internal_Shdr
*symtab_hdr
;
221 struct elf_link_hash_entry
**sym_hashes
;
222 bfd_vma
*local_got_offsets
;
223 const Elf_Internal_Rela
*rel
;
224 const Elf_Internal_Rela
*rel_end
;
229 if (info
->relocateable
)
232 dynobj
= elf_hash_table (info
)->dynobj
;
233 symtab_hdr
= &elf_tdata (abfd
)->symtab_hdr
;
234 sym_hashes
= elf_sym_hashes (abfd
);
235 local_got_offsets
= elf_local_got_offsets (abfd
);
241 rel_end
= relocs
+ sec
->reloc_count
;
242 for (rel
= relocs
; rel
< rel_end
; rel
++)
244 unsigned long r_symndx
;
245 struct elf_link_hash_entry
*h
;
247 r_symndx
= ELF32_R_SYM (rel
->r_info
);
249 if (r_symndx
< symtab_hdr
->sh_info
)
252 h
= sym_hashes
[r_symndx
- symtab_hdr
->sh_info
];
254 switch (ELF32_R_TYPE (rel
->r_info
))
262 /* This symbol requires a global offset table entry. */
265 && strcmp (h
->root
.root
.string
, "_GLOBAL_OFFSET_TABLE_") == 0)
270 /* Create the .got section. */
271 elf_hash_table (info
)->dynobj
= dynobj
= abfd
;
272 if (!_bfd_elf_create_got_section (dynobj
, info
))
278 sgot
= bfd_get_section_by_name (dynobj
, ".got");
279 BFD_ASSERT (sgot
!= NULL
);
283 && (h
!= NULL
|| info
->shared
))
285 srelgot
= bfd_get_section_by_name (dynobj
, ".rela.got");
288 srelgot
= bfd_make_section (dynobj
, ".rela.got");
290 || !bfd_set_section_flags (dynobj
, srelgot
,
296 || !bfd_set_section_alignment (dynobj
, srelgot
, 2))
303 if (h
->got_offset
!= (bfd_vma
) -1)
305 /* We have already allocated space in the .got. */
308 h
->got_offset
= sgot
->_raw_size
;
310 /* Make sure this symbol is output as a dynamic symbol. */
311 if (h
->dynindx
== -1)
313 if (!bfd_elf32_link_record_dynamic_symbol (info
, h
))
317 srelgot
->_raw_size
+= sizeof (Elf32_External_Rela
);
321 /* This is a global offset table entry for a local
323 if (local_got_offsets
== NULL
)
326 register unsigned int i
;
328 size
= symtab_hdr
->sh_info
* sizeof (bfd_vma
);
329 local_got_offsets
= (bfd_vma
*) bfd_alloc (abfd
, size
);
330 if (local_got_offsets
== NULL
)
332 elf_local_got_offsets (abfd
) = local_got_offsets
;
333 for (i
= 0; i
< symtab_hdr
->sh_info
; i
++)
334 local_got_offsets
[i
] = (bfd_vma
) -1;
336 if (local_got_offsets
[r_symndx
] != (bfd_vma
) -1)
338 /* We have already allocated space in the .got. */
341 local_got_offsets
[r_symndx
] = sgot
->_raw_size
;
345 /* If we are generating a shared object, we need to
346 output a R_68K_RELATIVE reloc so that the dynamic
347 linker can adjust this GOT entry. */
348 srelgot
->_raw_size
+= sizeof (Elf32_External_Rela
);
352 sgot
->_raw_size
+= 4;
361 /* This symbol requires a procedure linkage table entry. We
362 actually build the entry in adjust_dynamic_symbol,
363 because this might be a case of linking PIC code without
364 linking in any dynamic objects, in which case we don't
365 need to generate a procedure linkage table after all. */
367 /* If this is a local symbol, we resolve it directly without
368 creating a procedure linkage table entry. */
372 /* Make sure this symbol is output as a dynamic symbol. */
373 if (h
->dynindx
== -1)
375 if (!bfd_elf32_link_record_dynamic_symbol (info
, h
))
379 h
->elf_link_hash_flags
|= ELF_LINK_HASH_NEEDS_PLT
;
392 && (sec
->flags
& SEC_ALLOC
) != 0)
394 /* When creating a shared object, we must copy these
395 reloc types into the output file. We create a reloc
396 section in dynobj and make room for this reloc. */
401 name
= (bfd_elf_string_from_elf_section
403 elf_elfheader (abfd
)->e_shstrndx
,
404 elf_section_data (sec
)->rel_hdr
.sh_name
));
408 BFD_ASSERT (strncmp (name
, ".rela", 5) == 0
409 && strcmp (bfd_get_section_name (abfd
, sec
),
412 sreloc
= bfd_get_section_by_name (dynobj
, name
);
415 sreloc
= bfd_make_section (dynobj
, name
);
417 || !bfd_set_section_flags (dynobj
, sreloc
,
423 || !bfd_set_section_alignment (dynobj
, sreloc
, 2))
428 sreloc
->_raw_size
+= sizeof (Elf32_External_Rela
);
441 /* Adjust a symbol defined by a dynamic object and referenced by a
442 regular object. The current definition is in some section of the
443 dynamic object, but we're not including those sections. We have to
444 change the definition to something the rest of the link can
448 elf_m68k_adjust_dynamic_symbol (info
, h
)
449 struct bfd_link_info
*info
;
450 struct elf_link_hash_entry
*h
;
454 unsigned int power_of_two
;
456 dynobj
= elf_hash_table (info
)->dynobj
;
458 /* Make sure we know what is going on here. */
459 BFD_ASSERT (dynobj
!= NULL
460 && ((h
->elf_link_hash_flags
& ELF_LINK_HASH_NEEDS_PLT
)
461 || h
->weakdef
!= NULL
462 || ((h
->elf_link_hash_flags
463 & ELF_LINK_HASH_DEF_DYNAMIC
) != 0
464 && (h
->elf_link_hash_flags
465 & ELF_LINK_HASH_REF_REGULAR
) != 0
466 && (h
->elf_link_hash_flags
467 & ELF_LINK_HASH_DEF_REGULAR
) == 0)));
469 /* If this is a function, put it in the procedure linkage table. We
470 will fill in the contents of the procedure linkage table later,
471 when we know the address of the .got section. */
472 if (h
->type
== STT_FUNC
473 || (h
->elf_link_hash_flags
& ELF_LINK_HASH_NEEDS_PLT
) != 0)
475 if (!elf_hash_table (info
)->dynamic_sections_created
)
477 /* This case can occur if we saw a PLT32 reloc in an input
478 file, but none of the input files were dynamic objects.
479 In such a case, we don't actually need to build a
480 procedure linkage table, and we can just do a PC32 reloc
482 BFD_ASSERT ((h
->elf_link_hash_flags
& ELF_LINK_HASH_NEEDS_PLT
) != 0);
486 s
= bfd_get_section_by_name (dynobj
, ".plt");
487 BFD_ASSERT (s
!= NULL
);
489 /* If this is the first .plt entry, make room for the special
491 if (s
->_raw_size
== 0)
492 s
->_raw_size
+= PLT_ENTRY_SIZE
;
494 /* If this symbol is not defined in a regular file, and we are
495 not generating a shared library, then set the symbol to this
496 location in the .plt. This is required to make function
497 pointers compare as equal between the normal executable and
498 the shared library. */
500 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR
) == 0)
502 h
->root
.u
.def
.section
= s
;
503 h
->root
.u
.def
.value
= s
->_raw_size
;
506 h
->plt_offset
= s
->_raw_size
;
508 /* Make room for this entry. */
509 s
->_raw_size
+= PLT_ENTRY_SIZE
;
511 /* We also need to make an entry in the .got.plt section, which
512 will be placed in the .got section by the linker script. */
514 s
= bfd_get_section_by_name (dynobj
, ".got.plt");
515 BFD_ASSERT (s
!= NULL
);
518 /* We also need to make an entry in the .rela.plt section. */
520 s
= bfd_get_section_by_name (dynobj
, ".rela.plt");
521 BFD_ASSERT (s
!= NULL
);
522 s
->_raw_size
+= sizeof (Elf32_External_Rela
);
527 /* If this is a weak symbol, and there is a real definition, the
528 processor independent code will have arranged for us to see the
529 real definition first, and we can just use the same value. */
530 if (h
->weakdef
!= NULL
)
532 BFD_ASSERT (h
->weakdef
->root
.type
== bfd_link_hash_defined
533 || h
->weakdef
->root
.type
== bfd_link_hash_defweak
);
534 h
->root
.u
.def
.section
= h
->weakdef
->root
.u
.def
.section
;
535 h
->root
.u
.def
.value
= h
->weakdef
->root
.u
.def
.value
;
539 /* This is a reference to a symbol defined by a dynamic object which
540 is not a function. */
542 /* If we are creating a shared library, we must presume that the
543 only references to the symbol are via the global offset table.
544 For such cases we need not do anything here; the relocations will
545 be handled correctly by relocate_section. */
549 /* We must allocate the symbol in our .dynbss section, which will
550 become part of the .bss section of the executable. There will be
551 an entry for this symbol in the .dynsym section. The dynamic
552 object will contain position independent code, so all references
553 from the dynamic object to this symbol will go through the global
554 offset table. The dynamic linker will use the .dynsym entry to
555 determine the address it must put in the global offset table, so
556 both the dynamic object and the regular object will refer to the
557 same memory location for the variable. */
559 s
= bfd_get_section_by_name (dynobj
, ".dynbss");
560 BFD_ASSERT (s
!= NULL
);
562 /* If the symbol is currently defined in the .bss section of the
563 dynamic object, then it is OK to simply initialize it to zero.
564 If the symbol is in some other section, we must generate a
565 R_68K_COPY reloc to tell the dynamic linker to copy the initial
566 value out of the dynamic object and into the runtime process
567 image. We need to remember the offset into the .rela.bss section
568 we are going to use. */
569 if ((h
->root
.u
.def
.section
->flags
& SEC_LOAD
) != 0)
573 srel
= bfd_get_section_by_name (dynobj
, ".rela.bss");
574 BFD_ASSERT (srel
!= NULL
);
575 srel
->_raw_size
+= sizeof (Elf32_External_Rela
);
576 h
->elf_link_hash_flags
|= ELF_LINK_HASH_NEEDS_COPY
;
579 /* We need to figure out the alignment required for this symbol. I
580 have no idea how ELF linkers handle this. */
581 power_of_two
= bfd_log2 (h
->size
);
582 if (power_of_two
> 3)
585 /* Apply the required alignment. */
586 s
->_raw_size
= BFD_ALIGN (s
->_raw_size
,
587 (bfd_size_type
) (1 << power_of_two
));
588 if (power_of_two
> bfd_get_section_alignment (dynobj
, s
))
590 if (!bfd_set_section_alignment (dynobj
, s
, power_of_two
))
594 /* Define the symbol as being at this point in the section. */
595 h
->root
.u
.def
.section
= s
;
596 h
->root
.u
.def
.value
= s
->_raw_size
;
598 /* Increment the section size to make room for the symbol. */
599 s
->_raw_size
+= h
->size
;
604 /* Set the sizes of the dynamic sections. */
607 elf_m68k_size_dynamic_sections (output_bfd
, info
)
609 struct bfd_link_info
*info
;
617 dynobj
= elf_hash_table (info
)->dynobj
;
618 BFD_ASSERT (dynobj
!= NULL
);
620 if (elf_hash_table (info
)->dynamic_sections_created
)
622 /* Set the contents of the .interp section to the interpreter. */
625 s
= bfd_get_section_by_name (dynobj
, ".interp");
626 BFD_ASSERT (s
!= NULL
);
627 s
->_raw_size
= sizeof ELF_DYNAMIC_INTERPRETER
;
628 s
->contents
= (unsigned char *) ELF_DYNAMIC_INTERPRETER
;
633 /* We may have created entries in the .rela.got section.
634 However, if we are not creating the dynamic sections, we will
635 not actually use these entries. Reset the size of .rela.got,
636 which will cause it to get stripped from the output file
638 s
= bfd_get_section_by_name (dynobj
, ".rela.got");
643 /* The check_relocs and adjust_dynamic_symbol entry points have
644 determined the sizes of the various dynamic sections. Allocate
649 for (s
= dynobj
->sections
; s
!= NULL
; s
= s
->next
)
654 if ((s
->flags
& SEC_IN_MEMORY
) == 0)
657 /* It's OK to base decisions on the section name, because none
658 of the dynobj section names depend upon the input files. */
659 name
= bfd_get_section_name (dynobj
, s
);
663 if (strcmp (name
, ".plt") == 0)
665 if (s
->_raw_size
== 0)
667 /* Strip this section if we don't need it; see the
673 /* Remember whether there is a PLT. */
677 else if (strncmp (name
, ".rela", 5) == 0)
679 if (s
->_raw_size
== 0)
681 /* If we don't need this section, strip it from the
682 output file. This is mostly to handle .rela.bss and
683 .rela.plt. We must create both sections in
684 create_dynamic_sections, because they must be created
685 before the linker maps input sections to output
686 sections. The linker does that before
687 adjust_dynamic_symbol is called, and it is that
688 function which decides whether anything needs to go
689 into these sections. */
696 /* Remember whether there are any reloc sections other
698 if (strcmp (name
, ".rela.plt") != 0)
702 /* If this relocation section applies to a read only
703 section, then we probably need a DT_TEXTREL
704 entry. .rela.plt is actually associated with
705 .got.plt, which is never readonly. */
706 target
= bfd_get_section_by_name (output_bfd
, name
+ 5);
708 && (target
->flags
& SEC_READONLY
) != 0)
712 /* We use the reloc_count field as a counter if we need
713 to copy relocs into the output file. */
717 else if (strncmp (name
, ".got", 4) != 0)
719 /* It's not one of our sections, so don't allocate space. */
727 for (spp
= &s
->output_section
->owner
->sections
;
728 *spp
!= s
->output_section
;
731 *spp
= s
->output_section
->next
;
732 --s
->output_section
->owner
->section_count
;
737 /* Allocate memory for the section contents. */
738 s
->contents
= (bfd_byte
*) bfd_alloc (dynobj
, s
->_raw_size
);
739 if (s
->contents
== NULL
&& s
->_raw_size
!= 0)
743 if (elf_hash_table (info
)->dynamic_sections_created
)
745 /* Add some entries to the .dynamic section. We fill in the
746 values later, in elf_m68k_finish_dynamic_sections, but we
747 must add the entries now so that we get the correct size for
748 the .dynamic section. The DT_DEBUG entry is filled in by the
749 dynamic linker and used by the debugger. */
752 if (!bfd_elf32_add_dynamic_entry (info
, DT_DEBUG
, 0))
758 if (!bfd_elf32_add_dynamic_entry (info
, DT_PLTGOT
, 0)
759 || !bfd_elf32_add_dynamic_entry (info
, DT_PLTRELSZ
, 0)
760 || !bfd_elf32_add_dynamic_entry (info
, DT_PLTREL
, DT_RELA
)
761 || !bfd_elf32_add_dynamic_entry (info
, DT_JMPREL
, 0))
767 if (!bfd_elf32_add_dynamic_entry (info
, DT_RELA
, 0)
768 || !bfd_elf32_add_dynamic_entry (info
, DT_RELASZ
, 0)
769 || !bfd_elf32_add_dynamic_entry (info
, DT_RELAENT
,
770 sizeof (Elf32_External_Rela
)))
776 if (!bfd_elf32_add_dynamic_entry (info
, DT_TEXTREL
, 0))
784 /* Relocate an M68K ELF section. */
787 elf_m68k_relocate_section (output_bfd
, info
, input_bfd
, input_section
,
788 contents
, relocs
, local_syms
, local_sections
)
790 struct bfd_link_info
*info
;
792 asection
*input_section
;
794 Elf_Internal_Rela
*relocs
;
795 Elf_Internal_Sym
*local_syms
;
796 asection
**local_sections
;
799 Elf_Internal_Shdr
*symtab_hdr
;
800 struct elf_link_hash_entry
**sym_hashes
;
801 bfd_vma
*local_got_offsets
;
806 Elf_Internal_Rela
*rel
;
807 Elf_Internal_Rela
*relend
;
809 dynobj
= elf_hash_table (info
)->dynobj
;
810 symtab_hdr
= &elf_tdata (input_bfd
)->symtab_hdr
;
811 sym_hashes
= elf_sym_hashes (input_bfd
);
812 local_got_offsets
= elf_local_got_offsets (input_bfd
);
820 relend
= relocs
+ input_section
->reloc_count
;
821 for (; rel
< relend
; rel
++)
824 reloc_howto_type
*howto
;
825 unsigned long r_symndx
;
826 struct elf_link_hash_entry
*h
;
827 Elf_Internal_Sym
*sym
;
830 bfd_reloc_status_type r
;
832 r_type
= ELF32_R_TYPE (rel
->r_info
);
833 if (r_type
< 0 || r_type
>= (int) R_68K__max
)
835 bfd_set_error (bfd_error_bad_value
);
838 howto
= howto_table
+ r_type
;
840 r_symndx
= ELF32_R_SYM (rel
->r_info
);
842 if (info
->relocateable
)
844 /* This is a relocateable link. We don't have to change
845 anything, unless the reloc is against a section symbol,
846 in which case we have to adjust according to where the
847 section symbol winds up in the output section. */
848 if (r_symndx
< symtab_hdr
->sh_info
)
850 sym
= local_syms
+ r_symndx
;
851 if (ELF_ST_TYPE (sym
->st_info
) == STT_SECTION
)
853 sec
= local_sections
[r_symndx
];
854 rel
->r_addend
+= sec
->output_offset
+ sym
->st_value
;
861 /* This is a final link. */
865 if (r_symndx
< symtab_hdr
->sh_info
)
867 sym
= local_syms
+ r_symndx
;
868 sec
= local_sections
[r_symndx
];
869 relocation
= (sec
->output_section
->vma
875 h
= sym_hashes
[r_symndx
- symtab_hdr
->sh_info
];
876 if (h
->root
.type
== bfd_link_hash_defined
877 || h
->root
.type
== bfd_link_hash_defweak
)
879 sec
= h
->root
.u
.def
.section
;
880 if (((r_type
== R_68K_PLT8
881 || r_type
== R_68K_PLT16
882 || r_type
== R_68K_PLT32
883 || r_type
== R_68K_PLT8O
884 || r_type
== R_68K_PLT16O
885 || r_type
== R_68K_PLT32O
)
886 && h
->plt_offset
!= (bfd_vma
) -1)
887 || ((r_type
== R_68K_GOT8O
888 || r_type
== R_68K_GOT16O
889 || r_type
== R_68K_GOT32O
890 || ((r_type
== R_68K_GOT8
891 || r_type
== R_68K_GOT16
892 || r_type
== R_68K_GOT32
)
893 && strcmp (h
->root
.root
.string
,
894 "_GLOBAL_OFFSET_TABLE_") != 0))
895 && elf_hash_table (info
)->dynamic_sections_created
898 || (h
->elf_link_hash_flags
899 & ELF_LINK_HASH_DEF_REGULAR
) == 0))
901 && (input_section
->flags
& SEC_ALLOC
) != 0
902 && (r_type
== R_68K_8
903 || r_type
== R_68K_16
904 || r_type
== R_68K_32
905 || r_type
== R_68K_PC8
906 || r_type
== R_68K_PC16
907 || r_type
== R_68K_PC32
)))
909 /* In these cases, we don't need the relocation
910 value. We check specially because in some
911 obscure cases sec->output_section will be NULL. */
915 relocation
= (h
->root
.u
.def
.value
916 + sec
->output_section
->vma
917 + sec
->output_offset
);
919 else if (h
->root
.type
== bfd_link_hash_undefweak
)
921 else if (info
->shared
&& !info
->symbolic
)
925 if (!(info
->callbacks
->undefined_symbol
926 (info
, h
->root
.root
.string
, input_bfd
,
927 input_section
, rel
->r_offset
)))
938 /* Relocation is to the entry for this symbol in the global
941 && strcmp (h
->root
.root
.string
, "_GLOBAL_OFFSET_TABLE_") == 0)
947 /* Relocation is the offset of the entry for this symbol in
948 the global offset table. */
952 sgot
= bfd_get_section_by_name (dynobj
, ".got");
953 BFD_ASSERT (sgot
!= NULL
);
958 sgotplt
= bfd_get_section_by_name (dynobj
, ".got.plt");
959 BFD_ASSERT (sgotplt
!= NULL
);
967 BFD_ASSERT (off
!= (bfd_vma
) -1);
969 if (!elf_hash_table (info
)->dynamic_sections_created
972 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR
)))
974 /* This is actually a static link, or it is a
975 -Bsymbolic link and the symbol is defined
976 locally. We must initialize this entry in the
977 global offset table. Since the offset must
978 always be a multiple of 4, we use the least
979 significant bit to record whether we have
980 initialized it already.
982 When doing a dynamic link, we create a .rela.got
983 relocation entry to initialize the value. This
984 is done in the finish_dynamic_symbol routine. */
989 bfd_put_32 (output_bfd
, relocation
,
990 sgot
->contents
+ off
);
995 relocation
= sgot
->output_offset
+ off
;
996 if (r_type
== R_68K_GOT8O
997 || r_type
== R_68K_GOT16O
998 || r_type
== R_68K_GOT32O
)
999 relocation
-= sgotplt
->output_offset
;
1005 BFD_ASSERT (local_got_offsets
!= NULL
1006 && local_got_offsets
[r_symndx
] != (bfd_vma
) -1);
1008 off
= local_got_offsets
[r_symndx
];
1010 /* The offset must always be a multiple of 4. We use
1011 the least significant bit to record whether we have
1012 already generated the necessary reloc. */
1017 bfd_put_32 (output_bfd
, relocation
, sgot
->contents
+ off
);
1022 Elf_Internal_Rela outrel
;
1024 srelgot
= bfd_get_section_by_name (dynobj
, ".rela.got");
1025 BFD_ASSERT (srelgot
!= NULL
);
1027 outrel
.r_offset
= (sgot
->output_section
->vma
1028 + sgot
->output_offset
1030 outrel
.r_info
= ELF32_R_INFO (0, R_68K_RELATIVE
);
1031 outrel
.r_addend
= 0;
1032 bfd_elf32_swap_reloca_out (output_bfd
, &outrel
,
1033 (((Elf32_External_Rela
*)
1035 + srelgot
->reloc_count
));
1036 ++srelgot
->reloc_count
;
1039 local_got_offsets
[r_symndx
] |= 1;
1042 relocation
= sgot
->output_offset
+ off
;
1043 if (r_type
== R_68K_GOT8O
1044 || r_type
== R_68K_GOT16O
1045 || r_type
== R_68K_GOT32O
)
1046 relocation
-= sgotplt
->output_offset
;
1054 /* Relocation is to the entry for this symbol in the
1055 procedure linkage table. */
1057 /* Resolve a PLT32 reloc against a local symbol directly,
1058 without using the procedure linkage table. */
1062 if (h
->plt_offset
== (bfd_vma
) -1)
1064 /* We didn't make a PLT entry for this symbol. This
1065 happens when statically linking PIC code, or when
1066 using -Bsymbolic. */
1072 splt
= bfd_get_section_by_name (dynobj
, ".plt");
1073 BFD_ASSERT (splt
!= NULL
);
1076 relocation
= (splt
->output_section
->vma
1077 + splt
->output_offset
1084 /* Relocation is the offset of the entry for this symbol in
1085 the procedure linkage table. */
1086 BFD_ASSERT (h
!= NULL
);
1088 if (h
->plt_offset
== (bfd_vma
) -1)
1090 /* We didn't make a PLT entry for this symbol. This
1091 happens when statically linking PIC code. */
1097 splt
= bfd_get_section_by_name (dynobj
, ".plt");
1098 BFD_ASSERT (splt
!= NULL
);
1101 relocation
= h
->plt_offset
;
1114 && (input_section
->flags
& SEC_ALLOC
) != 0)
1116 Elf_Internal_Rela outrel
;
1118 /* When generating a shared object, these relocations
1119 are copied into the output file to be resolved at run
1126 name
= (bfd_elf_string_from_elf_section
1128 elf_elfheader (input_bfd
)->e_shstrndx
,
1129 elf_section_data (input_section
)->rel_hdr
.sh_name
));
1133 BFD_ASSERT (strncmp (name
, ".rela", 5) == 0
1134 && strcmp (bfd_get_section_name (input_bfd
,
1138 sreloc
= bfd_get_section_by_name (dynobj
, name
);
1139 BFD_ASSERT (sreloc
!= NULL
);
1142 outrel
.r_offset
= (rel
->r_offset
1143 + input_section
->output_section
->vma
1144 + input_section
->output_offset
);
1147 BFD_ASSERT (h
->dynindx
!= -1);
1148 outrel
.r_info
= ELF32_R_INFO (h
->dynindx
, r_type
);
1149 outrel
.r_addend
= rel
->r_addend
;
1153 if (r_type
== R_68K_32
)
1155 outrel
.r_info
= ELF32_R_INFO (0, R_68K_RELATIVE
);
1156 outrel
.r_addend
= relocation
+ rel
->r_addend
;
1162 sym
= local_syms
+ r_symndx
;
1164 BFD_ASSERT (ELF_ST_TYPE (sym
->st_info
) == STT_SECTION
);
1166 sec
= local_sections
[r_symndx
];
1167 if (sec
!= NULL
&& bfd_is_abs_section (sec
))
1169 else if (sec
== NULL
|| sec
->owner
== NULL
)
1171 bfd_set_error (bfd_error_bad_value
);
1178 osec
= sec
->output_section
;
1179 indx
= elf_section_data (osec
)->dynindx
;
1184 outrel
.r_info
= ELF32_R_INFO (indx
, r_type
);
1185 outrel
.r_addend
= relocation
+ rel
->r_addend
;
1189 bfd_elf32_swap_reloca_out (output_bfd
, &outrel
,
1190 (((Elf32_External_Rela
*)
1192 + sreloc
->reloc_count
));
1193 ++sreloc
->reloc_count
;
1195 /* This reloc will be computed at runtime, so there's no
1196 need to do anything now. */
1206 r
= _bfd_final_link_relocate (howto
, input_bfd
, input_section
,
1207 contents
, rel
->r_offset
,
1208 relocation
, rel
->r_addend
);
1210 if (r
!= bfd_reloc_ok
)
1215 case bfd_reloc_outofrange
:
1217 case bfd_reloc_overflow
:
1222 name
= h
->root
.root
.string
;
1225 name
= bfd_elf_string_from_elf_section (input_bfd
,
1226 symtab_hdr
->sh_link
,
1231 name
= bfd_section_name (input_bfd
, sec
);
1233 if (!(info
->callbacks
->reloc_overflow
1234 (info
, name
, howto
->name
, (bfd_vma
) 0,
1235 input_bfd
, input_section
, rel
->r_offset
)))
1246 /* Finish up dynamic symbol handling. We set the contents of various
1247 dynamic sections here. */
1250 elf_m68k_finish_dynamic_symbol (output_bfd
, info
, h
, sym
)
1252 struct bfd_link_info
*info
;
1253 struct elf_link_hash_entry
*h
;
1254 Elf_Internal_Sym
*sym
;
1258 dynobj
= elf_hash_table (info
)->dynobj
;
1260 if (h
->plt_offset
!= (bfd_vma
) -1)
1267 Elf_Internal_Rela rela
;
1269 /* This symbol has an entry in the procedure linkage table. Set
1272 BFD_ASSERT (h
->dynindx
!= -1);
1274 splt
= bfd_get_section_by_name (dynobj
, ".plt");
1275 sgot
= bfd_get_section_by_name (dynobj
, ".got.plt");
1276 srela
= bfd_get_section_by_name (dynobj
, ".rela.plt");
1277 BFD_ASSERT (splt
!= NULL
&& sgot
!= NULL
&& srela
!= NULL
);
1279 /* Get the index in the procedure linkage table which
1280 corresponds to this symbol. This is the index of this symbol
1281 in all the symbols for which we are making plt entries. The
1282 first entry in the procedure linkage table is reserved. */
1283 plt_index
= h
->plt_offset
/ PLT_ENTRY_SIZE
- 1;
1285 /* Get the offset into the .got table of the entry that
1286 corresponds to this function. Each .got entry is 4 bytes.
1287 The first three are reserved. */
1288 got_offset
= (plt_index
+ 3) * 4;
1290 /* Fill in the entry in the procedure linkage table. */
1291 memcpy (splt
->contents
+ h
->plt_offset
, elf_m68k_plt_entry
,
1293 /* The offset is relative to the first extension word. */
1294 bfd_put_32 (output_bfd
,
1295 (sgot
->output_section
->vma
1296 + sgot
->output_offset
1298 - (splt
->output_section
->vma
1299 + h
->plt_offset
+ 2)),
1300 splt
->contents
+ h
->plt_offset
+ 4);
1302 bfd_put_32 (output_bfd
, plt_index
* sizeof (Elf32_External_Rela
),
1303 splt
->contents
+ h
->plt_offset
+ 10);
1304 bfd_put_32 (output_bfd
, - (h
->plt_offset
+ 16),
1305 splt
->contents
+ h
->plt_offset
+ 16);
1307 /* Fill in the entry in the global offset table. */
1308 bfd_put_32 (output_bfd
,
1309 (splt
->output_section
->vma
1310 + splt
->output_offset
1313 sgot
->contents
+ got_offset
);
1315 /* Fill in the entry in the .rela.plt section. */
1316 rela
.r_offset
= (sgot
->output_section
->vma
1317 + sgot
->output_offset
1319 rela
.r_info
= ELF32_R_INFO (h
->dynindx
, R_68K_JMP_SLOT
);
1321 bfd_elf32_swap_reloca_out (output_bfd
, &rela
,
1322 ((Elf32_External_Rela
*) srela
->contents
1325 if ((h
->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR
) == 0)
1327 /* Mark the symbol as undefined, rather than as defined in
1328 the .plt section. Leave the value alone. */
1329 sym
->st_shndx
= SHN_UNDEF
;
1333 if (h
->got_offset
!= (bfd_vma
) -1)
1337 Elf_Internal_Rela rela
;
1339 /* This symbol has an entry in the global offset table. Set it
1342 BFD_ASSERT (h
->dynindx
!= -1);
1344 sgot
= bfd_get_section_by_name (dynobj
, ".got");
1345 srela
= bfd_get_section_by_name (dynobj
, ".rela.got");
1346 BFD_ASSERT (sgot
!= NULL
&& srela
!= NULL
);
1348 rela
.r_offset
= (sgot
->output_section
->vma
1349 + sgot
->output_offset
1350 + (h
->got_offset
&~ 1));
1352 /* If this is a -Bsymbolic link, and the symbol is defined
1353 locally, we just want to emit a RELATIVE reloc. The entry in
1354 the global offset table will already have been initialized in
1355 the relocate_section function. */
1358 && (h
->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR
))
1359 rela
.r_info
= ELF32_R_INFO (0, R_68K_RELATIVE
);
1362 bfd_put_32 (output_bfd
, (bfd_vma
) 0, sgot
->contents
+ h
->got_offset
);
1363 rela
.r_info
= ELF32_R_INFO (h
->dynindx
, R_68K_GLOB_DAT
);
1367 bfd_elf32_swap_reloca_out (output_bfd
, &rela
,
1368 ((Elf32_External_Rela
*) srela
->contents
1369 + srela
->reloc_count
));
1370 ++srela
->reloc_count
;
1373 if ((h
->elf_link_hash_flags
& ELF_LINK_HASH_NEEDS_COPY
) != 0)
1376 Elf_Internal_Rela rela
;
1378 /* This symbol needs a copy reloc. Set it up. */
1380 BFD_ASSERT (h
->dynindx
!= -1
1381 && (h
->root
.type
== bfd_link_hash_defined
1382 || h
->root
.type
== bfd_link_hash_defweak
));
1384 s
= bfd_get_section_by_name (h
->root
.u
.def
.section
->owner
,
1386 BFD_ASSERT (s
!= NULL
);
1388 rela
.r_offset
= (h
->root
.u
.def
.value
1389 + h
->root
.u
.def
.section
->output_section
->vma
1390 + h
->root
.u
.def
.section
->output_offset
);
1391 rela
.r_info
= ELF32_R_INFO (h
->dynindx
, R_68K_COPY
);
1393 bfd_elf32_swap_reloca_out (output_bfd
, &rela
,
1394 ((Elf32_External_Rela
*) s
->contents
1399 /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
1400 if (strcmp (h
->root
.root
.string
, "_DYNAMIC") == 0
1401 || strcmp (h
->root
.root
.string
, "_GLOBAL_OFFSET_TABLE_") == 0)
1402 sym
->st_shndx
= SHN_ABS
;
1407 /* Finish up the dynamic sections. */
1410 elf_m68k_finish_dynamic_sections (output_bfd
, info
)
1412 struct bfd_link_info
*info
;
1418 dynobj
= elf_hash_table (info
)->dynobj
;
1420 sgot
= bfd_get_section_by_name (dynobj
, ".got.plt");
1421 BFD_ASSERT (sgot
!= NULL
);
1422 sdyn
= bfd_get_section_by_name (dynobj
, ".dynamic");
1424 if (elf_hash_table (info
)->dynamic_sections_created
)
1427 Elf32_External_Dyn
*dyncon
, *dynconend
;
1429 splt
= bfd_get_section_by_name (dynobj
, ".plt");
1430 BFD_ASSERT (splt
!= NULL
&& sdyn
!= NULL
);
1432 dyncon
= (Elf32_External_Dyn
*) sdyn
->contents
;
1433 dynconend
= (Elf32_External_Dyn
*) (sdyn
->contents
+ sdyn
->_raw_size
);
1434 for (; dyncon
< dynconend
; dyncon
++)
1436 Elf_Internal_Dyn dyn
;
1440 bfd_elf32_swap_dyn_in (dynobj
, dyncon
, &dyn
);
1453 s
= bfd_get_section_by_name (output_bfd
, name
);
1454 BFD_ASSERT (s
!= NULL
);
1455 dyn
.d_un
.d_ptr
= s
->vma
;
1456 bfd_elf32_swap_dyn_out (output_bfd
, &dyn
, dyncon
);
1460 s
= bfd_get_section_by_name (output_bfd
, ".rela.plt");
1461 BFD_ASSERT (s
!= NULL
);
1462 if (s
->_cooked_size
!= 0)
1463 dyn
.d_un
.d_val
= s
->_cooked_size
;
1465 dyn
.d_un
.d_val
= s
->_raw_size
;
1466 bfd_elf32_swap_dyn_out (output_bfd
, &dyn
, dyncon
);
1470 /* My reading of the SVR4 ABI indicates that the
1471 procedure linkage table relocs (DT_JMPREL) should be
1472 included in the overall relocs (DT_RELA). This is
1473 what Solaris does. However, UnixWare can not handle
1474 that case. Therefore, we override the DT_RELASZ entry
1475 here to make it not include the JMPREL relocs. Since
1476 the linker script arranges for .rela.plt to follow all
1477 other relocation sections, we don't have to worry
1478 about changing the DT_RELA entry. */
1479 /* FIXME: This comment is from elf32-i386.c, what about
1480 the SVR4/m68k implementations? */
1481 s
= bfd_get_section_by_name (output_bfd
, ".rela.plt");
1484 if (s
->_cooked_size
!= 0)
1485 dyn
.d_un
.d_val
-= s
->_cooked_size
;
1487 dyn
.d_un
.d_val
-= s
->_raw_size
;
1489 bfd_elf32_swap_dyn_out (output_bfd
, &dyn
, dyncon
);
1494 /* Fill in the first entry in the procedure linkage table. */
1495 if (splt
->_raw_size
> 0)
1497 memcpy (splt
->contents
, elf_m68k_plt0_entry
, PLT_ENTRY_SIZE
);
1498 bfd_put_32 (output_bfd
,
1499 (sgot
->output_section
->vma
1500 + sgot
->output_offset
+ 4
1501 - (splt
->output_section
->vma
+ 2)),
1502 splt
->contents
+ 4);
1503 bfd_put_32 (output_bfd
,
1504 (sgot
->output_section
->vma
1505 + sgot
->output_offset
+ 8
1506 - (splt
->output_section
->vma
+ 10)),
1507 splt
->contents
+ 12);
1510 elf_section_data (splt
->output_section
)->this_hdr
.sh_entsize
1514 /* Fill in the first three entries in the global offset table. */
1515 if (sgot
->_raw_size
> 0)
1518 bfd_put_32 (output_bfd
, (bfd_vma
) 0, sgot
->contents
);
1520 bfd_put_32 (output_bfd
,
1521 sdyn
->output_section
->vma
+ sdyn
->output_offset
,
1523 bfd_put_32 (output_bfd
, (bfd_vma
) 0, sgot
->contents
+ 4);
1524 bfd_put_32 (output_bfd
, (bfd_vma
) 0, sgot
->contents
+ 8);
1527 elf_section_data (sgot
->output_section
)->this_hdr
.sh_entsize
= 4;
1532 #define TARGET_BIG_SYM bfd_elf32_m68k_vec
1533 #define TARGET_BIG_NAME "elf32-m68k"
1534 #define ELF_MACHINE_CODE EM_68K
1535 #define ELF_MAXPAGESIZE 0x2000
1536 #define elf_backend_create_dynamic_sections \
1537 _bfd_elf_create_dynamic_sections
1538 #define elf_backend_check_relocs elf_m68k_check_relocs
1539 #define elf_backend_adjust_dynamic_symbol \
1540 elf_m68k_adjust_dynamic_symbol
1541 #define elf_backend_size_dynamic_sections \
1542 elf_m68k_size_dynamic_sections
1543 #define elf_backend_relocate_section elf_m68k_relocate_section
1544 #define elf_backend_finish_dynamic_symbol \
1545 elf_m68k_finish_dynamic_symbol
1546 #define elf_backend_finish_dynamic_sections \
1547 elf_m68k_finish_dynamic_sections
1548 #define elf_backend_want_got_plt 1
1549 #define elf_backend_plt_readonly 1
1550 #define elf_backend_want_plt_sym 0
1552 #include "elf32-target.h"