Merge pull request #859 from jpoimboe/ppc-TOC

create-diff-object: don't convert .TOC. references to dynrelas
This commit is contained in:
Joe Lawrence 2018-05-30 14:09:02 -04:00 committed by GitHub
commit a879d1f3ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2467,8 +2467,17 @@ static int function_ptr_rela(const struct rela *rela)
static int may_need_dynrela(const struct rela *rela)
{
/*
* References to .TOC. are treated specially by the module loader and
* should never be converted to dynrelas.
*/
if (rela->type == R_PPC64_REL16_HA || rela->type == R_PPC64_REL16_LO ||
rela->type == R_PPC64_REL64)
return 0;
if (!rela->sym->sec)
return 1;
/*
* Nested functions used as callbacks are a special case.
* They are not supposed to be visible outside of the