Remove unnecessary elfcpp_config.h file.
[deliverable/binutils-gdb.git] / gold / reloc.cc
CommitLineData
61ba1cf9
ILT
1// reloc.cc -- relocate input files for gold.
2
3#include "gold.h"
4
5#include "workqueue.h"
6#include "object.h"
5a6f7e2d 7#include "symtab.h"
61ba1cf9
ILT
8#include "output.h"
9#include "reloc.h"
10
11namespace gold
12{
13
92e059d8
ILT
14// Read_relocs methods.
15
16// These tasks just read the relocation information from the file.
17// After reading it, the start another task to process the
18// information. These tasks requires access to the file.
19
20Task::Is_runnable_type
21Read_relocs::is_runnable(Workqueue*)
22{
23 return this->object_->is_locked() ? IS_LOCKED : IS_RUNNABLE;
24}
25
26// Lock the file.
27
28Task_locker*
29Read_relocs::locks(Workqueue*)
30{
31 return new Task_locker_obj<Object>(*this->object_);
32}
33
34// Read the relocations and then start a Scan_relocs_task.
35
36void
37Read_relocs::run(Workqueue* workqueue)
38{
39 Read_relocs_data *rd = new Read_relocs_data;
40 this->object_->read_relocs(rd);
41 workqueue->queue_front(new Scan_relocs(this->options_, this->symtab_,
ead1e424
ILT
42 this->layout_, this->object_, rd,
43 this->symtab_lock_, this->blocker_));
92e059d8
ILT
44}
45
46// Scan_relocs methods.
47
48// These tasks scan the relocations read by Read_relocs and mark up
49// the symbol table to indicate which relocations are required. We
50// use a lock on the symbol table to keep them from interfering with
51// each other.
52
53Task::Is_runnable_type
54Scan_relocs::is_runnable(Workqueue*)
55{
ead1e424
ILT
56 if (!this->symtab_lock_->is_writable() || this->object_->is_locked())
57 return IS_LOCKED;
58 return IS_RUNNABLE;
92e059d8
ILT
59}
60
61// Return the locks we hold: one on the file, one on the symbol table
62// and one blocker.
63
64class Scan_relocs::Scan_relocs_locker : public Task_locker
65{
66 public:
67 Scan_relocs_locker(Object* object, Task_token& symtab_lock, Task* task,
68 Task_token& blocker, Workqueue* workqueue)
69 : objlock_(*object), symtab_locker_(symtab_lock, task),
70 blocker_(blocker, workqueue)
71 { }
72
73 private:
74 Task_locker_obj<Object> objlock_;
75 Task_locker_write symtab_locker_;
76 Task_locker_block blocker_;
77};
78
79Task_locker*
80Scan_relocs::locks(Workqueue* workqueue)
81{
82 return new Scan_relocs_locker(this->object_, *this->symtab_lock_, this,
83 *this->blocker_, workqueue);
84}
85
86// Scan the relocs.
87
88void
89Scan_relocs::run(Workqueue*)
90{
ead1e424
ILT
91 this->object_->scan_relocs(this->options_, this->symtab_, this->layout_,
92 this->rd_);
92e059d8
ILT
93 delete this->rd_;
94 this->rd_ = NULL;
95}
96
61ba1cf9
ILT
97// Relocate_task methods.
98
99// These tasks are always runnable.
100
101Task::Is_runnable_type
102Relocate_task::is_runnable(Workqueue*)
103{
104 return IS_RUNNABLE;
105}
106
107// We want to lock the file while we run. We want to unblock
108// FINAL_BLOCKER when we are done.
109
110class Relocate_task::Relocate_locker : public Task_locker
111{
112 public:
113 Relocate_locker(Task_token& token, Workqueue* workqueue,
114 Object* object)
115 : blocker_(token, workqueue), objlock_(*object)
116 { }
117
118 private:
119 Task_locker_block blocker_;
120 Task_locker_obj<Object> objlock_;
121};
122
123Task_locker*
124Relocate_task::locks(Workqueue* workqueue)
125{
126 return new Relocate_locker(*this->final_blocker_, workqueue,
127 this->object_);
128}
129
130// Run the task.
131
132void
133Relocate_task::run(Workqueue*)
134{
92e059d8 135 this->object_->relocate(this->options_, this->symtab_, this->layout_,
61ba1cf9
ILT
136 this->of_);
137}
138
92e059d8
ILT
139// Read the relocs and local symbols from the object file and store
140// the information in RD.
141
142template<int size, bool big_endian>
143void
f6ce93d6 144Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd)
92e059d8
ILT
145{
146 rd->relocs.clear();
147
148 unsigned int shnum = this->shnum();
149 if (shnum == 0)
150 return;
151
152 rd->relocs.reserve(shnum / 2);
153
645f8123 154 const unsigned char *pshdrs = this->get_view(this->elf_file_.shoff(),
92e059d8
ILT
155 shnum * This::shdr_size);
156 // Skip the first, dummy, section.
157 const unsigned char *ps = pshdrs + This::shdr_size;
158 for (unsigned int i = 1; i < shnum; ++i, ps += This::shdr_size)
159 {
160 typename This::Shdr shdr(ps);
161
162 unsigned int sh_type = shdr.get_sh_type();
163 if (sh_type != elfcpp::SHT_REL && sh_type != elfcpp::SHT_RELA)
164 continue;
165
166 unsigned int shndx = shdr.get_sh_info();
167 if (shndx >= shnum)
168 {
169 fprintf(stderr, _("%s: %s: relocation section %u has bad info %u\n"),
170 program_name, this->name().c_str(), i, shndx);
171 gold_exit(false);
172 }
173
174 if (!this->is_section_included(shndx))
175 continue;
176
ead1e424
ILT
177 // We are scanning relocations in order to fill out the GOT and
178 // PLT sections. Relocations for sections which are not
179 // allocated (typically debugging sections) should not add new
180 // GOT and PLT entries. So we skip them.
181 typename This::Shdr secshdr(pshdrs + shndx * This::shdr_size);
182 if ((secshdr.get_sh_flags() & elfcpp::SHF_ALLOC) == 0)
183 continue;
184
645f8123 185 if (shdr.get_sh_link() != this->symtab_shndx_)
92e059d8
ILT
186 {
187 fprintf(stderr,
188 _("%s: %s: relocation section %u uses unexpected "
189 "symbol table %u\n"),
190 program_name, this->name().c_str(), i, shdr.get_sh_link());
191 gold_exit(false);
192 }
193
194 off_t sh_size = shdr.get_sh_size();
195
196 unsigned int reloc_size;
197 if (sh_type == elfcpp::SHT_REL)
198 reloc_size = elfcpp::Elf_sizes<size>::rel_size;
199 else
200 reloc_size = elfcpp::Elf_sizes<size>::rela_size;
201 if (reloc_size != shdr.get_sh_entsize())
202 {
203 fprintf(stderr,
204 _("%s: %s: unexpected entsize for reloc section %u: "
205 "%lu != %u"),
206 program_name, this->name().c_str(), i,
207 static_cast<unsigned long>(shdr.get_sh_entsize()),
208 reloc_size);
209 gold_exit(false);
210 }
211
212 size_t reloc_count = sh_size / reloc_size;
213 if (reloc_count * reloc_size != sh_size)
214 {
215 fprintf(stderr, _("%s: %s: reloc section %u size %lu uneven"),
216 program_name, this->name().c_str(), i,
217 static_cast<unsigned long>(sh_size));
218 gold_exit(false);
219 }
220
221 rd->relocs.push_back(Section_relocs());
222 Section_relocs& sr(rd->relocs.back());
223 sr.reloc_shndx = i;
224 sr.data_shndx = shndx;
225 sr.contents = this->get_lasting_view(shdr.get_sh_offset(), sh_size);
226 sr.sh_type = sh_type;
227 sr.reloc_count = reloc_count;
228 }
229
230 // Read the local symbols.
a3ad94ed 231 gold_assert(this->symtab_shndx_ != -1U);
645f8123 232 if (this->symtab_shndx_ == 0 || this->local_symbol_count_ == 0)
92e059d8
ILT
233 rd->local_symbols = NULL;
234 else
235 {
236 typename This::Shdr symtabshdr(pshdrs
645f8123 237 + this->symtab_shndx_ * This::shdr_size);
a3ad94ed 238 gold_assert(symtabshdr.get_sh_type() == elfcpp::SHT_SYMTAB);
92e059d8
ILT
239 const int sym_size = This::sym_size;
240 const unsigned int loccount = this->local_symbol_count_;
a3ad94ed 241 gold_assert(loccount == symtabshdr.get_sh_info());
92e059d8
ILT
242 off_t locsize = loccount * sym_size;
243 rd->local_symbols = this->get_lasting_view(symtabshdr.get_sh_offset(),
244 locsize);
245 }
246}
247
248// Scan the relocs and adjust the symbol table. This looks for
249// relocations which require GOT/PLT/COPY relocations.
250
251template<int size, bool big_endian>
252void
f6ce93d6 253Sized_relobj<size, big_endian>::do_scan_relocs(const General_options& options,
92e059d8 254 Symbol_table* symtab,
ead1e424 255 Layout* layout,
92e059d8
ILT
256 Read_relocs_data* rd)
257{
258 Sized_target<size, big_endian>* target = this->sized_target();
259
260 const unsigned char* local_symbols;
261 if (rd->local_symbols == NULL)
262 local_symbols = NULL;
263 else
264 local_symbols = rd->local_symbols->data();
265
266 for (Read_relocs_data::Relocs_list::iterator p = rd->relocs.begin();
267 p != rd->relocs.end();
268 ++p)
269 {
a3ad94ed
ILT
270 target->scan_relocs(options, symtab, layout, this, p->data_shndx,
271 p->sh_type, p->contents->data(), p->reloc_count,
92e059d8
ILT
272 this->local_symbol_count_,
273 local_symbols,
274 this->symbols_);
275 delete p->contents;
276 p->contents = NULL;
277 }
278
279 if (rd->local_symbols != NULL)
280 {
281 delete rd->local_symbols;
282 rd->local_symbols = NULL;
283 }
284}
285
61ba1cf9
ILT
286// Relocate the input sections and write out the local symbols.
287
288template<int size, bool big_endian>
289void
f6ce93d6 290Sized_relobj<size, big_endian>::do_relocate(const General_options& options,
61ba1cf9 291 const Symbol_table* symtab,
92e059d8 292 const Layout* layout,
61ba1cf9
ILT
293 Output_file* of)
294{
295 unsigned int shnum = this->shnum();
296
297 // Read the section headers.
645f8123 298 const unsigned char* pshdrs = this->get_view(this->elf_file_.shoff(),
61ba1cf9
ILT
299 shnum * This::shdr_size);
300
301 Views views;
302 views.resize(shnum);
303
304 // Make two passes over the sections. The first one copies the
305 // section data to the output file. The second one applies
306 // relocations.
307
308 this->write_sections(pshdrs, of, &views);
309
310 // Apply relocations.
311
92e059d8 312 this->relocate_sections(options, symtab, layout, pshdrs, &views);
61ba1cf9
ILT
313
314 // Write out the accumulated views.
315 for (unsigned int i = 1; i < shnum; ++i)
316 {
317 if (views[i].view != NULL)
318 of->write_output_view(views[i].offset, views[i].view_size,
319 views[i].view);
320 }
321
322 // Write out the local symbols.
92e059d8 323 this->write_local_symbols(of, layout->sympool());
61ba1cf9
ILT
324}
325
326// Write section data to the output file. PSHDRS points to the
327// section headers. Record the views in *PVIEWS for use when
328// relocating.
329
330template<int size, bool big_endian>
331void
f6ce93d6 332Sized_relobj<size, big_endian>::write_sections(const unsigned char* pshdrs,
61ba1cf9
ILT
333 Output_file* of,
334 Views* pviews)
335{
336 unsigned int shnum = this->shnum();
337 std::vector<Map_to_output>& map_sections(this->map_to_output());
338
339 const unsigned char* p = pshdrs + This::shdr_size;
340 for (unsigned int i = 1; i < shnum; ++i, p += This::shdr_size)
341 {
342 View_size* pvs = &(*pviews)[i];
343
344 pvs->view = NULL;
345
b8e6aad9
ILT
346 if (map_sections[i].offset == -1)
347 continue;
348
61ba1cf9
ILT
349 const Output_section* os = map_sections[i].output_section;
350 if (os == NULL)
351 continue;
352
353 typename This::Shdr shdr(p);
354
355 if (shdr.get_sh_type() == elfcpp::SHT_NOBITS)
356 continue;
357
61ba1cf9
ILT
358 off_t start = os->offset() + map_sections[i].offset;
359 off_t sh_size = shdr.get_sh_size();
360
ead1e424
ILT
361 if (sh_size == 0)
362 continue;
363
a3ad94ed
ILT
364 gold_assert(map_sections[i].offset >= 0
365 && map_sections[i].offset + sh_size <= os->data_size());
ead1e424 366
61ba1cf9 367 unsigned char* view = of->get_output_view(start, sh_size);
92e059d8
ILT
368 this->read(shdr.get_sh_offset(), sh_size, view);
369
61ba1cf9
ILT
370 pvs->view = view;
371 pvs->address = os->address() + map_sections[i].offset;
372 pvs->offset = start;
373 pvs->view_size = sh_size;
374 }
375}
376
377// Relocate section data. VIEWS points to the section data as views
378// in the output file.
379
380template<int size, bool big_endian>
381void
f6ce93d6 382Sized_relobj<size, big_endian>::relocate_sections(
92e059d8
ILT
383 const General_options& options,
384 const Symbol_table* symtab,
385 const Layout* layout,
386 const unsigned char* pshdrs,
387 Views* pviews)
61ba1cf9
ILT
388{
389 unsigned int shnum = this->shnum();
61ba1cf9
ILT
390 Sized_target<size, big_endian>* target = this->sized_target();
391
92e059d8
ILT
392 Relocate_info<size, big_endian> relinfo;
393 relinfo.options = &options;
394 relinfo.symtab = symtab;
395 relinfo.layout = layout;
396 relinfo.object = this;
397 relinfo.local_symbol_count = this->local_symbol_count_;
c06b7b0b 398 relinfo.local_values = &this->local_values_;
92e059d8
ILT
399 relinfo.symbols = this->symbols_;
400
61ba1cf9
ILT
401 const unsigned char* p = pshdrs + This::shdr_size;
402 for (unsigned int i = 1; i < shnum; ++i, p += This::shdr_size)
403 {
404 typename This::Shdr shdr(p);
405
406 unsigned int sh_type = shdr.get_sh_type();
407 if (sh_type != elfcpp::SHT_REL && sh_type != elfcpp::SHT_RELA)
408 continue;
409
410 unsigned int index = shdr.get_sh_info();
411 if (index >= this->shnum())
412 {
413 fprintf(stderr, _("%s: %s: relocation section %u has bad info %u\n"),
414 program_name, this->name().c_str(), i, index);
415 gold_exit(false);
416 }
417
92e059d8 418 if (!this->is_section_included(index))
61ba1cf9
ILT
419 {
420 // This relocation section is against a section which we
421 // discarded.
422 continue;
423 }
424
a3ad94ed 425 gold_assert((*pviews)[index].view != NULL);
61ba1cf9 426
645f8123 427 if (shdr.get_sh_link() != this->symtab_shndx_)
61ba1cf9
ILT
428 {
429 fprintf(stderr,
430 _("%s: %s: relocation section %u uses unexpected "
431 "symbol table %u\n"),
432 program_name, this->name().c_str(), i, shdr.get_sh_link());
433 gold_exit(false);
434 }
435
436 off_t sh_size = shdr.get_sh_size();
437 const unsigned char* prelocs = this->get_view(shdr.get_sh_offset(),
438 sh_size);
439
440 unsigned int reloc_size;
441 if (sh_type == elfcpp::SHT_REL)
442 reloc_size = elfcpp::Elf_sizes<size>::rel_size;
443 else
444 reloc_size = elfcpp::Elf_sizes<size>::rela_size;
445
446 if (reloc_size != shdr.get_sh_entsize())
447 {
448 fprintf(stderr,
449 _("%s: %s: unexpected entsize for reloc section %u: "
450 "%lu != %u"),
451 program_name, this->name().c_str(), i,
452 static_cast<unsigned long>(shdr.get_sh_entsize()),
453 reloc_size);
454 gold_exit(false);
455 }
456
457 size_t reloc_count = sh_size / reloc_size;
458 if (reloc_count * reloc_size != sh_size)
459 {
460 fprintf(stderr, _("%s: %s: reloc section %u size %lu uneven"),
461 program_name, this->name().c_str(), i,
462 static_cast<unsigned long>(sh_size));
463 gold_exit(false);
464 }
465
92e059d8
ILT
466 relinfo.reloc_shndx = i;
467 relinfo.data_shndx = index;
468 target->relocate_section(&relinfo,
469 sh_type,
470 prelocs,
471 reloc_count,
61ba1cf9
ILT
472 (*pviews)[index].view,
473 (*pviews)[index].address,
474 (*pviews)[index].view_size);
475 }
476}
477
5a6f7e2d
ILT
478// Copy_relocs::Copy_reloc_entry methods.
479
480// Return whether we should emit this reloc. We should emit it if the
481// symbol is still defined in a dynamic object. If we should not emit
482// it, we clear it, to save ourselves the test next time.
483
484template<int size, bool big_endian>
485bool
486Copy_relocs<size, big_endian>::Copy_reloc_entry::should_emit()
487{
488 if (this->sym_ == NULL)
489 return false;
14b31740 490 if (this->sym_->is_from_dynobj())
5a6f7e2d
ILT
491 return true;
492 this->sym_ = NULL;
493 return false;
494}
495
496// Emit a reloc into a SHT_REL section.
497
498template<int size, bool big_endian>
499void
500Copy_relocs<size, big_endian>::Copy_reloc_entry::emit(
501 Output_data_reloc<elfcpp::SHT_REL, true, size, big_endian>* reloc_data)
502{
16649710 503 this->sym_->set_needs_dynsym_entry();
5a6f7e2d
ILT
504 reloc_data->add_global(this->sym_, this->reloc_type_, this->relobj_,
505 this->shndx_, this->address_);
506}
507
508// Emit a reloc into a SHT_RELA section.
509
510template<int size, bool big_endian>
511void
512Copy_relocs<size, big_endian>::Copy_reloc_entry::emit(
513 Output_data_reloc<elfcpp::SHT_RELA, true, size, big_endian>* reloc_data)
514{
16649710 515 this->sym_->set_needs_dynsym_entry();
5a6f7e2d
ILT
516 reloc_data->add_global(this->sym_, this->reloc_type_, this->relobj_,
517 this->shndx_, this->address_, this->addend_);
518}
519
520// Copy_relocs methods.
a3ad94ed
ILT
521
522// Return whether we need a COPY reloc for a relocation against GSYM.
523// The relocation is being applied to section SHNDX in OBJECT.
524
525template<int size, bool big_endian>
526bool
5a6f7e2d 527Copy_relocs<size, big_endian>::need_copy_reloc(
a3ad94ed
ILT
528 const General_options*,
529 Relobj* object,
530 unsigned int shndx,
5a6f7e2d 531 Sized_symbol<size>* sym)
a3ad94ed
ILT
532{
533 // FIXME: Handle -z nocopyrelocs.
534
5a6f7e2d
ILT
535 if (sym->symsize() == 0)
536 return false;
537
a3ad94ed
ILT
538 // If this is a readonly section, then we need a COPY reloc.
539 // Otherwise we can use a dynamic reloc.
540 if ((object->section_flags(shndx) & elfcpp::SHF_WRITE) == 0)
541 return true;
542
543 return false;
544}
545
5a6f7e2d
ILT
546// Save a Rel reloc.
547
548template<int size, bool big_endian>
549void
550Copy_relocs<size, big_endian>::save(
551 Symbol* sym,
552 Relobj* relobj,
553 unsigned int shndx,
554 const elfcpp::Rel<size, big_endian>& rel)
555{
556 unsigned int reloc_type = elfcpp::elf_r_type<size>(rel.get_r_info());
557 this->entries_.push_back(Copy_reloc_entry(sym, reloc_type, relobj, shndx,
558 rel.get_r_offset(), 0));
559}
560
561// Save a Rela reloc.
562
563template<int size, bool big_endian>
564void
565Copy_relocs<size, big_endian>::save(
566 Symbol* sym,
567 Relobj* relobj,
568 unsigned int shndx,
569 const elfcpp::Rela<size, big_endian>& rela)
570{
571 unsigned int reloc_type = elfcpp::elf_r_type<size>(rela.get_r_info());
572 this->entries_.push_back(Copy_reloc_entry(sym, reloc_type, relobj, shndx,
573 rela.get_r_offset(),
574 rela.get_r_addend()));
575}
576
577// Return whether there are any relocs to emit. We don't want to emit
578// a reloc if the symbol is no longer defined in a dynamic object.
579
580template<int size, bool big_endian>
581bool
582Copy_relocs<size, big_endian>::any_to_emit()
583{
584 for (typename Copy_reloc_entries::iterator p = this->entries_.begin();
585 p != this->entries_.end();
586 ++p)
587 {
588 if (p->should_emit())
589 return true;
590 }
591 return false;
592}
593
594// Emit relocs.
595
596template<int size, bool big_endian>
597template<int sh_type>
598void
599Copy_relocs<size, big_endian>::emit(
600 Output_data_reloc<sh_type, true, size, big_endian>* reloc_data)
601{
602 for (typename Copy_reloc_entries::iterator p = this->entries_.begin();
603 p != this->entries_.end();
604 ++p)
605 {
606 if (p->should_emit())
607 p->emit(reloc_data);
608 }
609}
610
61ba1cf9
ILT
611// Instantiate the templates we need. We could use the configure
612// script to restrict this to only the ones for implemented targets.
613
193a53d9 614#ifdef HAVE_TARGET_32_LITTLE
92e059d8
ILT
615template
616void
f6ce93d6 617Sized_relobj<32, false>::do_read_relocs(Read_relocs_data* rd);
193a53d9 618#endif
92e059d8 619
193a53d9 620#ifdef HAVE_TARGET_32_BIG
92e059d8
ILT
621template
622void
f6ce93d6 623Sized_relobj<32, true>::do_read_relocs(Read_relocs_data* rd);
193a53d9 624#endif
92e059d8 625
193a53d9 626#ifdef HAVE_TARGET_64_LITTLE
92e059d8
ILT
627template
628void
f6ce93d6 629Sized_relobj<64, false>::do_read_relocs(Read_relocs_data* rd);
193a53d9 630#endif
92e059d8 631
193a53d9 632#ifdef HAVE_TARGET_64_BIG
92e059d8
ILT
633template
634void
f6ce93d6 635Sized_relobj<64, true>::do_read_relocs(Read_relocs_data* rd);
193a53d9 636#endif
92e059d8 637
193a53d9 638#ifdef HAVE_TARGET_32_LITTLE
92e059d8
ILT
639template
640void
f6ce93d6 641Sized_relobj<32, false>::do_scan_relocs(const General_options& options,
92e059d8 642 Symbol_table* symtab,
ead1e424 643 Layout* layout,
92e059d8 644 Read_relocs_data* rd);
193a53d9 645#endif
92e059d8 646
193a53d9 647#ifdef HAVE_TARGET_32_BIG
92e059d8
ILT
648template
649void
f6ce93d6 650Sized_relobj<32, true>::do_scan_relocs(const General_options& options,
92e059d8 651 Symbol_table* symtab,
ead1e424 652 Layout* layout,
92e059d8 653 Read_relocs_data* rd);
193a53d9 654#endif
92e059d8 655
193a53d9 656#ifdef HAVE_TARGET_64_LITTLE
92e059d8
ILT
657template
658void
f6ce93d6 659Sized_relobj<64, false>::do_scan_relocs(const General_options& options,
92e059d8 660 Symbol_table* symtab,
ead1e424 661 Layout* layout,
92e059d8 662 Read_relocs_data* rd);
193a53d9 663#endif
92e059d8 664
193a53d9 665#ifdef HAVE_TARGET_64_BIG
92e059d8
ILT
666template
667void
f6ce93d6 668Sized_relobj<64, true>::do_scan_relocs(const General_options& options,
92e059d8 669 Symbol_table* symtab,
ead1e424 670 Layout* layout,
92e059d8 671 Read_relocs_data* rd);
193a53d9 672#endif
92e059d8 673
193a53d9 674#ifdef HAVE_TARGET_32_LITTLE
61ba1cf9
ILT
675template
676void
f6ce93d6 677Sized_relobj<32, false>::do_relocate(const General_options& options,
61ba1cf9 678 const Symbol_table* symtab,
92e059d8 679 const Layout* layout,
61ba1cf9 680 Output_file* of);
193a53d9 681#endif
61ba1cf9 682
193a53d9 683#ifdef HAVE_TARGET_32_BIG
61ba1cf9
ILT
684template
685void
f6ce93d6 686Sized_relobj<32, true>::do_relocate(const General_options& options,
61ba1cf9 687 const Symbol_table* symtab,
92e059d8 688 const Layout* layout,
61ba1cf9 689 Output_file* of);
193a53d9 690#endif
61ba1cf9 691
193a53d9 692#ifdef HAVE_TARGET_64_LITTLE
61ba1cf9
ILT
693template
694void
f6ce93d6 695Sized_relobj<64, false>::do_relocate(const General_options& options,
61ba1cf9 696 const Symbol_table* symtab,
92e059d8 697 const Layout* layout,
61ba1cf9 698 Output_file* of);
193a53d9 699#endif
61ba1cf9 700
193a53d9 701#ifdef HAVE_TARGET_64_BIG
61ba1cf9
ILT
702template
703void
f6ce93d6 704Sized_relobj<64, true>::do_relocate(const General_options& options,
61ba1cf9 705 const Symbol_table* symtab,
92e059d8 706 const Layout* layout,
61ba1cf9 707 Output_file* of);
193a53d9 708#endif
61ba1cf9 709
193a53d9 710#ifdef HAVE_TARGET_32_LITTLE
a3ad94ed 711template
5a6f7e2d 712class Copy_relocs<32, false>;
193a53d9 713#endif
a3ad94ed 714
193a53d9 715#ifdef HAVE_TARGET_32_BIG
a3ad94ed 716template
5a6f7e2d 717class Copy_relocs<32, true>;
193a53d9 718#endif
a3ad94ed 719
193a53d9 720#ifdef HAVE_TARGET_64_LITTLE
a3ad94ed 721template
5a6f7e2d 722class Copy_relocs<64, false>;
193a53d9 723#endif
a3ad94ed 724
193a53d9 725#ifdef HAVE_TARGET_64_BIG
a3ad94ed 726template
5a6f7e2d 727class Copy_relocs<64, true>;
193a53d9 728#endif
5a6f7e2d 729
193a53d9 730#ifdef HAVE_TARGET_32_LITTLE
5a6f7e2d
ILT
731template
732void
733Copy_relocs<32, false>::emit<elfcpp::SHT_REL>(
734 Output_data_reloc<elfcpp::SHT_REL, true, 32, false>*);
193a53d9 735#endif
5a6f7e2d 736
193a53d9 737#ifdef HAVE_TARGET_32_BIG
5a6f7e2d
ILT
738template
739void
740Copy_relocs<32, true>::emit<elfcpp::SHT_REL>(
741 Output_data_reloc<elfcpp::SHT_REL, true, 32, true>*);
193a53d9 742#endif
5a6f7e2d 743
193a53d9 744#ifdef HAVE_TARGET_64_LITTLE
5a6f7e2d
ILT
745template
746void
747Copy_relocs<64, false>::emit<elfcpp::SHT_REL>(
748 Output_data_reloc<elfcpp::SHT_REL, true, 64, false>*);
193a53d9 749#endif
5a6f7e2d 750
193a53d9 751#ifdef HAVE_TARGET_64_BIG
5a6f7e2d
ILT
752template
753void
754Copy_relocs<64, true>::emit<elfcpp::SHT_REL>(
755 Output_data_reloc<elfcpp::SHT_REL, true, 64, true>*);
193a53d9 756#endif
5a6f7e2d 757
193a53d9 758#ifdef HAVE_TARGET_32_LITTLE
5a6f7e2d
ILT
759template
760void
761Copy_relocs<32, false>::emit<elfcpp::SHT_RELA>(
762 Output_data_reloc<elfcpp::SHT_RELA , true, 32, false>*);
193a53d9 763#endif
5a6f7e2d 764
193a53d9 765#ifdef HAVE_TARGET_32_BIG
5a6f7e2d
ILT
766template
767void
768Copy_relocs<32, true>::emit<elfcpp::SHT_RELA>(
769 Output_data_reloc<elfcpp::SHT_RELA, true, 32, true>*);
193a53d9 770#endif
5a6f7e2d 771
193a53d9 772#ifdef HAVE_TARGET_64_LITTLE
5a6f7e2d
ILT
773template
774void
775Copy_relocs<64, false>::emit<elfcpp::SHT_RELA>(
776 Output_data_reloc<elfcpp::SHT_RELA, true, 64, false>*);
193a53d9 777#endif
5a6f7e2d 778
193a53d9 779#ifdef HAVE_TARGET_64_BIG
5a6f7e2d
ILT
780template
781void
782Copy_relocs<64, true>::emit<elfcpp::SHT_RELA>(
783 Output_data_reloc<elfcpp::SHT_RELA, true, 64, true>*);
193a53d9 784#endif
61ba1cf9
ILT
785
786} // End namespace gold.
This page took 0.096952 seconds and 4 git commands to generate.