Skip to content

Commit 66990c0

Browse files
committed
scripts/sorttable: Have the ORC code use the _r() functions to read
The ORC code reads the section information directly from the file. This currently works because the default read function is for 64bit little endian machines. But if for some reason that ever changes, this will break. Instead of having a surprise breakage, use the _r() functions that will read the values from the file properly. Cc: bpf <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nicolas Schier <[email protected]> Cc: Zheng Yejian <[email protected]> Cc: Martin Kelly <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 6f2c2f9 commit 66990c0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/sorttable.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,14 @@ static int do_sort(Elf_Ehdr *ehdr,
299299
#if defined(SORTTABLE_64) && defined(UNWINDER_ORC_ENABLED)
300300
/* locate the ORC unwind tables */
301301
if (!strcmp(secstrings + idx, ".orc_unwind_ip")) {
302-
orc_ip_size = s->sh_size;
302+
orc_ip_size = _r(&s->sh_size);
303303
g_orc_ip_table = (int *)((void *)ehdr +
304-
s->sh_offset);
304+
_r(&s->sh_offset));
305305
}
306306
if (!strcmp(secstrings + idx, ".orc_unwind")) {
307-
orc_size = s->sh_size;
307+
orc_size = _r(&s->sh_size);
308308
g_orc_table = (struct orc_entry *)((void *)ehdr +
309-
s->sh_offset);
309+
_r(&s->sh_offset));
310310
}
311311
#endif
312312
} /* for loop */

0 commit comments

Comments
 (0)