// Merge object attributes from input object with those in the output.
void
- merge_object_attributes(const char*, const Attributes_section_data*);
+ merge_object_attributes(const Object*, const Attributes_section_data*);
private:
case elfcpp::R_PPC64_TLSLD:
case elfcpp::R_PPC64_TPREL34:
case elfcpp::R_PPC64_DTPREL34:
- case elfcpp::R_PPC64_GOT_TLSGD34:
- case elfcpp::R_PPC64_GOT_TLSLD34:
- case elfcpp::R_PPC64_GOT_TPREL34:
- case elfcpp::R_PPC64_GOT_DTPREL34:
+ case elfcpp::R_PPC64_GOT_TLSGD_PCREL34:
+ case elfcpp::R_PPC64_GOT_TLSLD_PCREL34:
+ case elfcpp::R_PPC64_GOT_TPREL_PCREL34:
+ case elfcpp::R_PPC64_GOT_DTPREL_PCREL34:
ref = Symbol::TLS_REF;
break;
target->got_section(symtab, layout);
break;
- case elfcpp::R_PPC64_GOT_TLSGD34:
+ case elfcpp::R_PPC64_GOT_TLSGD_PCREL34:
case elfcpp::R_POWERPC_GOT_TLSGD16:
case elfcpp::R_POWERPC_GOT_TLSGD16_LO:
case elfcpp::R_POWERPC_GOT_TLSGD16_HI:
}
break;
- case elfcpp::R_PPC64_GOT_TLSLD34:
+ case elfcpp::R_PPC64_GOT_TLSLD_PCREL34:
case elfcpp::R_POWERPC_GOT_TLSLD16:
case elfcpp::R_POWERPC_GOT_TLSLD16_LO:
case elfcpp::R_POWERPC_GOT_TLSLD16_HI:
}
break;
- case elfcpp::R_PPC64_GOT_DTPREL34:
+ case elfcpp::R_PPC64_GOT_DTPREL_PCREL34:
case elfcpp::R_POWERPC_GOT_DTPREL16:
case elfcpp::R_POWERPC_GOT_DTPREL16_LO:
case elfcpp::R_POWERPC_GOT_DTPREL16_HI:
}
break;
- case elfcpp::R_PPC64_GOT_TPREL34:
+ case elfcpp::R_PPC64_GOT_TPREL_PCREL34:
case elfcpp::R_POWERPC_GOT_TPREL16:
case elfcpp::R_POWERPC_GOT_TPREL16_LO:
case elfcpp::R_POWERPC_GOT_TPREL16_HI:
case elfcpp::R_PPC64_PLT_PCREL34:
case elfcpp::R_PPC64_PLT_PCREL34_NOTOC:
case elfcpp::R_PPC64_GOT_PCREL34:
- case elfcpp::R_PPC64_GOT_TLSGD34:
- case elfcpp::R_PPC64_GOT_TLSLD34:
- case elfcpp::R_PPC64_GOT_DTPREL34:
- case elfcpp::R_PPC64_GOT_TPREL34:
+ case elfcpp::R_PPC64_GOT_TLSGD_PCREL34:
+ case elfcpp::R_PPC64_GOT_TLSLD_PCREL34:
+ case elfcpp::R_PPC64_GOT_DTPREL_PCREL34:
+ case elfcpp::R_PPC64_GOT_TPREL_PCREL34:
target->set_power10_stubs();
break;
default:
target->got_section(symtab, layout);
break;
- case elfcpp::R_PPC64_GOT_TLSGD34:
+ case elfcpp::R_PPC64_GOT_TLSGD_PCREL34:
case elfcpp::R_POWERPC_GOT_TLSGD16:
case elfcpp::R_POWERPC_GOT_TLSGD16_LO:
case elfcpp::R_POWERPC_GOT_TLSGD16_HI:
}
break;
- case elfcpp::R_PPC64_GOT_TLSLD34:
+ case elfcpp::R_PPC64_GOT_TLSLD_PCREL34:
case elfcpp::R_POWERPC_GOT_TLSLD16:
case elfcpp::R_POWERPC_GOT_TLSLD16_LO:
case elfcpp::R_POWERPC_GOT_TLSLD16_HI:
}
break;
- case elfcpp::R_PPC64_GOT_DTPREL34:
+ case elfcpp::R_PPC64_GOT_DTPREL_PCREL34:
case elfcpp::R_POWERPC_GOT_DTPREL16:
case elfcpp::R_POWERPC_GOT_DTPREL16_LO:
case elfcpp::R_POWERPC_GOT_DTPREL16_HI:
}
break;
- case elfcpp::R_PPC64_GOT_TPREL34:
+ case elfcpp::R_PPC64_GOT_TPREL_PCREL34:
case elfcpp::R_POWERPC_GOT_TPREL16:
case elfcpp::R_POWERPC_GOT_TPREL16_LO:
case elfcpp::R_POWERPC_GOT_TPREL16_HI:
case elfcpp::R_PPC64_PLT_PCREL34:
case elfcpp::R_PPC64_PLT_PCREL34_NOTOC:
case elfcpp::R_PPC64_GOT_PCREL34:
- case elfcpp::R_PPC64_GOT_TLSGD34:
- case elfcpp::R_PPC64_GOT_TLSLD34:
- case elfcpp::R_PPC64_GOT_DTPREL34:
- case elfcpp::R_PPC64_GOT_TPREL34:
+ case elfcpp::R_PPC64_GOT_TLSGD_PCREL34:
+ case elfcpp::R_PPC64_GOT_TLSLD_PCREL34:
+ case elfcpp::R_PPC64_GOT_DTPREL_PCREL34:
+ case elfcpp::R_PPC64_GOT_TPREL_PCREL34:
target->set_power10_stubs();
break;
default:
Symbol_table* symtab,
Symbol* sym) const
{
- if (size == 64)
+ if (size == 64 && sym->object()->pluginobj() == NULL)
{
Powerpc_relobj<size, big_endian>* ppc_object
= static_cast<Powerpc_relobj<size, big_endian>*>(sym->object());
Powerpc_relobj<size, big_endian>* ppc_relobj
= static_cast<Powerpc_relobj<size, big_endian>*>(*p);
if (ppc_relobj->attributes_section_data())
- this->merge_object_attributes(ppc_relobj->name().c_str(),
+ this->merge_object_attributes(ppc_relobj,
ppc_relobj->attributes_section_data());
}
for (Input_objects::Dynobj_iterator p = input_objects->dynobj_begin();
Powerpc_dynobj<size, big_endian>* ppc_dynobj
= static_cast<Powerpc_dynobj<size, big_endian>*>(*p);
if (ppc_dynobj->attributes_section_data())
- this->merge_object_attributes(ppc_dynobj->name().c_str(),
+ this->merge_object_attributes(ppc_dynobj,
ppc_dynobj->attributes_section_data());
}
template<int size, bool big_endian>
void
Target_powerpc<size, big_endian>::merge_object_attributes(
- const char* name,
+ const Object* obj,
const Attributes_section_data* pasd)
{
// Return if there is no attributes section data.
Object_attribute* out_attr
= this->attributes_section_data_->known_attributes(vendor);
+ const char* name = obj->name().c_str();
const char* err;
const char* first;
const char* second;
int tag = elfcpp::Tag_GNU_Power_ABI_FP;
int in_fp = in_attr[tag].int_value() & 0xf;
int out_fp = out_attr[tag].int_value() & 0xf;
+ bool warn_only = obj->is_dynamic();
if (in_fp != out_fp)
{
err = NULL;
;
else if ((out_fp & 3) == 0)
{
- out_fp |= in_fp & 3;
- out_attr[tag].set_int_value(out_fp);
- out_attr[tag].set_type(Object_attribute::ATTR_TYPE_FLAG_INT_VAL);
- this->last_fp_ = name;
+ if (!warn_only)
+ {
+ out_fp |= in_fp & 3;
+ out_attr[tag].set_int_value(out_fp);
+ out_attr[tag].set_type(Object_attribute::ATTR_TYPE_FLAG_INT_VAL);
+ this->last_fp_ = name;
+ }
}
else if ((out_fp & 3) != 2 && (in_fp & 3) == 2)
{
;
else if ((out_fp & 0xc) == 0)
{
- out_fp |= in_fp & 0xc;
- out_attr[tag].set_int_value(out_fp);
- out_attr[tag].set_type(Object_attribute::ATTR_TYPE_FLAG_INT_VAL);
- this->last_ld_ = name;
+ if (!warn_only)
+ {
+ out_fp |= in_fp & 0xc;
+ out_attr[tag].set_int_value(out_fp);
+ out_attr[tag].set_type(Object_attribute::ATTR_TYPE_FLAG_INT_VAL);
+ this->last_ld_ = name;
+ }
}
else if ((out_fp & 0xc) != 2 * 4 && (in_fp & 0xc) == 2 * 4)
{
if (err)
{
if (parameters->options().warn_mismatch())
- gold_error(_(err), first, second);
+ {
+ if (warn_only)
+ gold_warning(_(err), first, second);
+ else
+ gold_error(_(err), first, second);
+ }
// Arrange for this attribute to be deleted. It's better to
// say "don't know" about a file than to wrongly claim compliance.
- out_attr[tag].set_type(0);
+ if (!warn_only)
+ out_attr[tag].set_type(0);
}
}
|| r_type == elfcpp::R_POWERPC_GOT_TLSGD16_LO
|| r_type == elfcpp::R_POWERPC_GOT_TLSGD16_HI
|| r_type == elfcpp::R_POWERPC_GOT_TLSGD16_HA
- || r_type == elfcpp::R_PPC64_GOT_TLSGD34)
+ || r_type == elfcpp::R_PPC64_GOT_TLSGD_PCREL34)
{
// First instruction of a global dynamic sequence, arg setup insn.
const bool final = gsym == NULL || gsym->final_value_is_known();
gold_assert(object->local_has_got_offset(r_sym, got_type));
value = object->local_got_offset(r_sym, got_type);
}
- if (r_type == elfcpp::R_PPC64_GOT_TLSGD34)
+ if (r_type == elfcpp::R_PPC64_GOT_TLSGD_PCREL34)
value += target->got_section()->address();
else
value -= target->got_section()->got_base_offset(object);
}
if (tls_type == tls::TLSOPT_TO_IE)
{
- if (r_type == elfcpp::R_PPC64_GOT_TLSGD34)
+ if (r_type == elfcpp::R_PPC64_GOT_TLSGD_PCREL34)
{
Insn* iview = reinterpret_cast<Insn*>(view);
uint64_t pinsn = elfcpp::Swap<32, big_endian>::readval(iview);
elfcpp::Swap<32, big_endian>::writeval(iview, pinsn >> 32);
elfcpp::Swap<32, big_endian>::writeval(iview + 1,
pinsn & 0xffffffff);
- r_type = elfcpp::R_PPC64_GOT_TPREL34;
+ r_type = elfcpp::R_PPC64_GOT_TPREL_PCREL34;
}
else
{
}
else if (tls_type == tls::TLSOPT_TO_LE)
{
- if (r_type == elfcpp::R_PPC64_GOT_TLSGD34)
+ if (r_type == elfcpp::R_PPC64_GOT_TLSGD_PCREL34)
{
Insn* iview = reinterpret_cast<Insn*>(view);
uint64_t pinsn = elfcpp::Swap<32, big_endian>::readval(iview);
|| r_type == elfcpp::R_POWERPC_GOT_TLSLD16_LO
|| r_type == elfcpp::R_POWERPC_GOT_TLSLD16_HI
|| r_type == elfcpp::R_POWERPC_GOT_TLSLD16_HA
- || r_type == elfcpp::R_PPC64_GOT_TLSLD34)
+ || r_type == elfcpp::R_PPC64_GOT_TLSLD_PCREL34)
{
// First instruction of a local dynamic sequence, arg setup insn.
const tls::Tls_optimization tls_type = target->optimize_tls_ld();
if (tls_type == tls::TLSOPT_NONE)
{
value = target->tlsld_got_offset();
- if (r_type == elfcpp::R_PPC64_GOT_TLSLD34)
+ if (r_type == elfcpp::R_PPC64_GOT_TLSLD_PCREL34)
value += target->got_section()->address();
else
value -= target->got_section()->got_base_offset(object);
else
{
gold_assert(tls_type == tls::TLSOPT_TO_LE);
- if (r_type == elfcpp::R_PPC64_GOT_TLSLD34)
+ if (r_type == elfcpp::R_PPC64_GOT_TLSLD_PCREL34)
{
Insn* iview = reinterpret_cast<Insn*>(view);
uint64_t pinsn = elfcpp::Swap<32, big_endian>::readval(iview);
|| r_type == elfcpp::R_POWERPC_GOT_DTPREL16_LO
|| r_type == elfcpp::R_POWERPC_GOT_DTPREL16_HI
|| r_type == elfcpp::R_POWERPC_GOT_DTPREL16_HA
- || r_type == elfcpp::R_PPC64_GOT_DTPREL34)
+ || r_type == elfcpp::R_PPC64_GOT_DTPREL_PCREL34)
{
// Accesses relative to a local dynamic sequence address,
// no optimisation here.
gold_assert(object->local_has_got_offset(r_sym, GOT_TYPE_DTPREL));
value = object->local_got_offset(r_sym, GOT_TYPE_DTPREL);
}
- if (r_type == elfcpp::R_PPC64_GOT_DTPREL34)
+ if (r_type == elfcpp::R_PPC64_GOT_DTPREL_PCREL34)
value += target->got_section()->address();
else
value -= target->got_section()->got_base_offset(object);
|| r_type == elfcpp::R_POWERPC_GOT_TPREL16_LO
|| r_type == elfcpp::R_POWERPC_GOT_TPREL16_HI
|| r_type == elfcpp::R_POWERPC_GOT_TPREL16_HA
- || r_type == elfcpp::R_PPC64_GOT_TPREL34)
+ || r_type == elfcpp::R_PPC64_GOT_TPREL_PCREL34)
{
// First instruction of initial exec sequence.
const bool final = gsym == NULL || gsym->final_value_is_known();
gold_assert(object->local_has_got_offset(r_sym, GOT_TYPE_TPREL));
value = object->local_got_offset(r_sym, GOT_TYPE_TPREL);
}
- if (r_type == elfcpp::R_PPC64_GOT_TPREL34)
+ if (r_type == elfcpp::R_PPC64_GOT_TPREL_PCREL34)
value += target->got_section()->address();
else
value -= target->got_section()->got_base_offset(object);
else
{
gold_assert(tls_type == tls::TLSOPT_TO_LE);
- if (r_type == elfcpp::R_PPC64_GOT_TPREL34)
+ if (r_type == elfcpp::R_PPC64_GOT_TPREL_PCREL34)
{
Insn* iview = reinterpret_cast<Insn*>(view);
uint64_t pinsn = elfcpp::Swap<32, big_endian>::readval(iview);
case elfcpp::R_PPC64_PLT_PCREL34:
case elfcpp::R_PPC64_PLT_PCREL34_NOTOC:
case elfcpp::R_PPC64_PCREL28:
- case elfcpp::R_PPC64_GOT_TLSGD34:
- case elfcpp::R_PPC64_GOT_TLSLD34:
- case elfcpp::R_PPC64_GOT_TPREL34:
- case elfcpp::R_PPC64_GOT_DTPREL34:
+ case elfcpp::R_PPC64_GOT_TLSGD_PCREL34:
+ case elfcpp::R_PPC64_GOT_TLSLD_PCREL34:
+ case elfcpp::R_PPC64_GOT_TPREL_PCREL34:
+ case elfcpp::R_PPC64_GOT_DTPREL_PCREL34:
case elfcpp::R_PPC64_REL16_HIGHER34:
case elfcpp::R_PPC64_REL16_HIGHERA34:
case elfcpp::R_PPC64_REL16_HIGHEST34:
case elfcpp::R_PPC64_PCREL28:
case elfcpp::R_PPC64_TPREL34:
case elfcpp::R_PPC64_DTPREL34:
- case elfcpp::R_PPC64_GOT_TLSGD34:
- case elfcpp::R_PPC64_GOT_TLSLD34:
- case elfcpp::R_PPC64_GOT_TPREL34:
- case elfcpp::R_PPC64_GOT_DTPREL34:
+ case elfcpp::R_PPC64_GOT_TLSGD_PCREL34:
+ case elfcpp::R_PPC64_GOT_TLSLD_PCREL34:
+ case elfcpp::R_PPC64_GOT_TPREL_PCREL34:
+ case elfcpp::R_PPC64_GOT_DTPREL_PCREL34:
overflow = Reloc::CHECK_SIGNED;
break;
}
case elfcpp::R_PPC64_PLT_PCREL34_NOTOC:
case elfcpp::R_PPC64_TPREL34:
case elfcpp::R_PPC64_DTPREL34:
- case elfcpp::R_PPC64_GOT_TLSGD34:
- case elfcpp::R_PPC64_GOT_TLSLD34:
- case elfcpp::R_PPC64_GOT_TPREL34:
- case elfcpp::R_PPC64_GOT_DTPREL34:
+ case elfcpp::R_PPC64_GOT_TLSGD_PCREL34:
+ case elfcpp::R_PPC64_GOT_TLSLD_PCREL34:
+ case elfcpp::R_PPC64_GOT_TPREL_PCREL34:
+ case elfcpp::R_PPC64_GOT_DTPREL_PCREL34:
if (size == 32)
goto unsupp;
status = Reloc::addr34(view, value, overflow);