Skip to content

Commit 16ad132

Browse files
l0kodacmel
authored andcommitted
samples/bpf: Ignore already processed ELF sections
Add a missing check for the map fixup loop. Signed-off-by: Mickaël Salaün <[email protected]> Acked-by: Joe Stringer <[email protected]> Acked-by: Wang Nan <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: David S. Miller <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent af392a8 commit 16ad132

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

samples/bpf/bpf_load.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ int load_bpf_file(char *path)
328328

329329
/* load programs that need map fixup (relocations) */
330330
for (i = 1; i < ehdr.e_shnum; i++) {
331+
if (processed_sec[i])
332+
continue;
331333

332334
if (get_sec(elf, i, &ehdr, &shname, &shdr, &data))
333335
continue;

0 commit comments

Comments
 (0)