powerpc gold, work around pr17670

Markus Trippelsdorf markus@trippelsdorf.de
Wed Dec 3 15:27:00 GMT 2014


On 2014.12.04 at 01:47 +1030, Alan Modra wrote:
> pr17670 is about an assert triggering on a branch to an undefined
> weak symbol, the symbol being undefined due to dropping its comdat
> group section.  (Well sort of.  The symbol is actually defined in
> an .opd section which isn't part of the group, but the code section
> the opd entry points at is dropped.)  So don't assert.
> Also, don't make long branch stubs to such symbols, and arrange to
> have target-reloc.h code warn when applying relocs that use the sym
> by making the sym seem to be undefined.  Making the sym undefined can
> be done via override_base() but using that function requires setting
> up an elfcpp::Sym, so I opted for a simpler new Symbol interface.

> @@ -7205,8 +7211,11 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
>  		value += object->ppc64_local_entry_offset(r_sym);
>  	    }
>  	  else
> -	    value = target->symval_for_branch(relinfo->symtab, value,
> -					      gsym, object, &dest_shndx);
> +	    {
> +	      unsigned int dest_shndx;
> +	      target->symval_for_branch(relinfo->symtab, gsym, object,
> +					&value, &dest_shndx))
> +	    }

Extra ')':

powerpc.cc: In member function ‘bool {anonymous}::Target_powerpc<size, big_endian>::Relocate::relocate(const gold::Relocate_info<size, big_endian>*, {anonymous}::Target_powerpc<size, big_endian>*, gold::Output_section*, size_t, const elfcpp::Rela<size, big_endian>&, unsigned int, const gold::Sized_symbol<size>*, const gold::Symbol_value<size>*, unsigned char*, {anonymous}::Target_powerpc<size, big_endian>::Address, gold::section_size_type)’:
powerpc.cc:7217:26: error: expected ‘;’ before ‘)’ token
      &value, &dest_shndx))

-- 
Markus



More information about the Binutils mailing list