]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gold/target.h
Fix bug with relocation addends and merge sections with --icf.
[thirdparty/binutils-gdb.git] / gold / target.h
index 8e801e18278e3f0f9d5321381b8b028fbda06692..da2f6bbc78c7eb65d70367480add47d0aa96566c 100644 (file)
@@ -1,6 +1,6 @@
 // target.h -- target support for gold   -*- C++ -*-
 
-// Copyright (C) 2006-2016 Free Software Foundation, Inc.
+// Copyright (C) 2006-2018 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -119,9 +119,19 @@ class Target
   { return this->pti_->dynamic_linker; }
 
   // Return the default address to use for the text segment.
+  // If a -z max-page-size argument has set the ABI page size
+  // to a value larger than the default starting address,
+  // bump the starting address up to the page size, to avoid
+  // misaligning the text segment in the file.
   uint64_t
   default_text_segment_address() const
-  { return this->pti_->default_text_segment_address; }
+  {
+    uint64_t addr = this->pti_->default_text_segment_address;
+    uint64_t pagesize = this->abi_pagesize();
+    if (addr < pagesize)
+      addr = pagesize;
+    return addr;
+  }
 
   // Return the ABI specified page size.
   uint64_t
@@ -464,6 +474,11 @@ class Target
   hash_entry_size() const
   { return this->pti_->hash_entry_size; }
 
+  // Return the section type to use for unwind sections.
+  unsigned int
+  unwind_section_type() const
+  { return this->pti_->unwind_section_type; }
+
   // Whether the target has a custom set_dynsym_indexes method.
   bool
   has_custom_set_dynsym_indexes() const
@@ -552,6 +567,9 @@ class Target
     // Size (in bits) of SHT_HASH entry. Always equal to 32, except for
     // 64-bit S/390.
     const int hash_entry_size;
+    // Processor-specific section type for ".eh_frame" (unwind) sections.
+    // SHT_PROGBITS if there is no special section type.
+    const unsigned int unwind_section_type;
   };
 
   Target(const Target_info* pti)
@@ -842,7 +860,7 @@ class Sized_target : public Target
   // pre-existing symbol.  SYM is the new symbol, seen in OBJECT.
   // VERSION is the version of SYM.  This will only be called if
   // has_resolve() returns true.
-  virtual void
+  virtual bool
   resolve(Symbol*, const elfcpp::Sym<size, big_endian>&, Object*,
          const char*)
   { gold_unreachable(); }