Skip to content

Do we need more robust archeticture protection #1356

@laokz

Description

@laokz

I noticed that there are many places using relocation types without #ifdef architecture protection, such as in create-diff-object.c:

	return (rela_toc && rela_toc->sym->type == STT_FUNC &&
		!rela_toc->sym->parent &&
		rela_toc->addend == (int)rela_toc->sym->sym.st_value &&
		(rela->type == R_X86_64_32S ||
		rela->type == R_PPC64_TOC16_HA ||
		rela->type == R_PPC64_TOC16_LO_DS));

All architectures relocation types use same number space. R_X86_64_32S value is 11. This value for PPC is R_PPC_REL14, for arm is R_ARM_THM_PC8. Could this break the code?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions