From 12c0daef5f792cf27f8d0897794bb32729dc370b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 16 Apr 2008 22:54:29 +0000 Subject: * copy-relocs.cc: New file. * copy-relocs.h: New file. * reloc.cc: Remove Copy_relocs code. * reloc.h: Likewise. * reloc-types.h (struct Reloc_types) [both versions]: Add get_reloc_addend_noerror. * output.h (class Output_data_reloc): Add variants of add_global which take an addend which must be zero. * i386.cc: Include "copy-relocs.h". (class Target_i386): Change type of copy_relocs_ to variable, update initializer. (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class. Change all callers. (Target_i386::do_finalize_sections): Change handling of copy_relocs_. * sparc.cc: Include "copy-relocs.h". (class Target_sparc): Change type of copy_relocs_ to variable, update initializer. (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class. Change all callers. (Target_sparc::do_finalize_sections): Change handling of copy_relocs_. * x86_64.cc: Include "copy-relocs.h". (class Target_x86_64): Change type of copy_relocs_ to variable, update initializer. (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs class. Change all callers. (Target_x86_64::do_finalize_sections): Change handling of copy_relocs_. * Makefile.am (CCFILES): Add copy-relocs.cc. (HFILES): Add copy-relocs.h. --- gold/output.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gold/output.h') diff --git a/gold/output.h b/gold/output.h index 81685e2..4772cb4a 100644 --- a/gold/output.h +++ b/gold/output.h @@ -1071,6 +1071,24 @@ class Output_data_reloc { this->add(od, Output_reloc_type(gsym, type, relobj, shndx, address, false)); } + // These are to simplify the Copy_relocs class. + + void + add_global(Symbol* gsym, unsigned int type, Output_data* od, Address address, + Address addend) + { + gold_assert(addend == 0); + this->add_global(gsym, type, od, address); + } + + void + add_global(Symbol* gsym, unsigned int type, Output_data* od, Relobj* relobj, + unsigned int shndx, Address address, Address addend) + { + gold_assert(addend == 0); + this->add_global(gsym, type, od, relobj, shndx, address); + } + // Add a RELATIVE reloc against a global symbol. The final relocation // will not reference the symbol. -- cgit v1.1