Skip to content

Commit b57508e

Browse files
authored
Merge pull request #1428 from bhllamoreaux/photon-patches
Patches from Photon OS
2 parents b15c09c + 846db25 commit b57508e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

kpatch-build/create-diff-object.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,19 +236,19 @@ static struct rela *toc_rela(const struct rela *rela)
236236
static void kpatch_bundle_symbols(struct kpatch_elf *kelf)
237237
{
238238
struct symbol *sym;
239-
unsigned int expected_offset;
239+
uint64_t expected_offset;
240240

241241
list_for_each_entry(sym, &kelf->symbols, list) {
242242
if (is_bundleable(sym)) {
243243
if (sym->pfx)
244-
expected_offset = 16;
244+
expected_offset = sym->pfx->sym.st_size;
245245
else if (is_gcc6_localentry_bundled_sym(kelf, sym))
246246
expected_offset = 8;
247247
else
248248
expected_offset = 0;
249249

250250
if (sym->sym.st_value != expected_offset) {
251-
ERROR("symbol %s at offset %lu within section %s, expected %u",
251+
ERROR("symbol %s at offset %lu within section %s, expected %lu",
252252
sym->name, sym->sym.st_value,
253253
sym->sec->name, expected_offset);
254254
}

kpatch-build/kpatch-elf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ static void kpatch_link_prefixed_functions(struct kpatch_elf *kelf)
470470

471471
list_for_each_entry(func, &kelf->symbols, list) {
472472
if (func->type == STT_FUNC && func->sec == pfx->sec &&
473-
func->sym.st_value == pfx->sym.st_value + 16) {
473+
func->sym.st_value == pfx->sym.st_value + pfx->sym.st_size) {
474474

475475
/*
476476
* If a func has aliases, it's possible for

0 commit comments

Comments
 (0)