X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gold%2Fobject.cc;h=c486a2011d5c4d5167272ca83d93cd20f90bbf3d;hb=f2e1c129f8f0985ec80e6cf775cf3e4afbced6fa;hp=86c519acf72db919ff1f6f2f5540f1514dbf3e10;hpb=cc5277b173701364c10204f316db28198f2c683b;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/object.cc b/gold/object.cc index 86c519acf7..c486a2011d 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -1,6 +1,6 @@ // object.cc -- support for an object file for linking in gold -// Copyright (C) 2006-2019 Free Software Foundation, Inc. +// Copyright (C) 2006-2020 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -1884,11 +1884,15 @@ Sized_relobj_file::do_layout(Symbol_table* symtab, if (strncmp (name, lto_section_name, strlen (lto_section_name)) == 0) { section_size_type contents_len; - const unsigned char* pcontents = this->section_contents(i, &contents_len, false); - struct lto_section lsection = *(const lto_section*)pcontents; - if (lsection.slim_object) - gold_info(_("%s: plugin needed to handle lto object"), - this->name().c_str()); + const unsigned char* pcontents + = this->section_contents(i, &contents_len, false); + if (contents_len >= sizeof(lto_section)) + { + const lto_section* lsection + = reinterpret_cast(pcontents); + if (lsection->slim_object) + layout->set_lto_slim_object(); + } } } @@ -2127,7 +2131,8 @@ Sized_relobj_file::do_add_symbols(Symbol_table* symtab, this->symbols_.resize(symcount); - if (layout->is_lto_slim_object ()) + if (!parameters->options().relocatable() + && layout->is_lto_slim_object ()) gold_info(_("%s: plugin needed to handle lto object"), this->name().c_str()); @@ -2641,6 +2646,10 @@ Sized_relobj_file::do_finalize_local_symbols( lv->set_output_symtab_index(index); ++index; } + if (lv->is_ifunc_symbol() + && (lv->has_output_symtab_entry() + || lv->needs_output_dynsym_entry())) + symtab->set_has_gnu_output(); break; case CFLV_DISCARDED: case CFLV_ERROR: