Merge pull request #980 from kamalesh-babulal/fixup

ppc64le: Feature fixup
This commit is contained in:
Joe Lawrence 2019-07-03 09:15:41 -04:00 committed by GitHub
commit 2f343f1861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,6 +82,7 @@ enum loglevel loglevel = NORMAL;
struct special_section {
char *name;
int (*group_size)(struct kpatch_elf *kelf, int offset);
int unsupported;
};
/*************
@ -1825,7 +1826,12 @@ static int fixup_entry_group_size(struct kpatch_elf *kelf, int offset)
static int fixup_lwsync_group_size(struct kpatch_elf *kelf, int offset)
{
return 4;
return 8;
}
static int fixup_barrier_nospec_group_size(struct kpatch_elf *kelf, int offset)
{
return 8;
}
#endif
@ -1908,18 +1914,27 @@ static struct special_section special_sections[] = {
{
.name = "__ftr_fixup",
.group_size = fixup_entry_group_size,
.unsupported = 1,
},
{
.name = "__mmu_ftr_fixup",
.group_size = fixup_entry_group_size,
.unsupported = 1,
},
{
.name = "__fw_ftr_fixup",
.group_size = fixup_entry_group_size,
.unsupported = 1,
},
{
.name = "__lwsync_fixup",
.group_size = fixup_lwsync_group_size,
.unsupported = 1,
},
{
.name = "__barrier_nospec_fixup",
.group_size = fixup_barrier_nospec_group_size,
.unsupported = 1,
},
#endif
{},
@ -2018,6 +2033,9 @@ static void kpatch_regenerate_special_section(struct kpatch_elf *kelf,
if (!include)
continue;
if (special->unsupported)
DIFF_FATAL("unsupported reference to special section %s", sec->base->name);
/*
* Copy all relas in the group. It's possible that the relas
* aren't sorted (e.g. .rela.fixup), so go through the entire