This fixes a regression introduced while converting pointer to
offset arithmetics.
The for-loop itself starts at 1 already, so reflect this with the
manually performed offset + length calculation right at the start.
Closes: https://github.com/kmod-project/kmod/issues/214
Fixes: 25ab561b ("libkmod: Use ELF offsets more often")
Reported-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/215
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
count = 0;
slen = 0;
str_off = str_sec_off;
- sym_off = sym_sec_off;
+ sym_off = sym_sec_off + symlen;
for (i = 1; i < symcount; i++, sym_off += symlen) {
const char *name;
uint32_t name_off;
itr = (char *)(a + count);
count = 0;
str_off = str_sec_off;
- sym_off = sym_sec_off;
+ sym_off = sym_sec_off + symlen;
for (i = 1; i < symcount; i++, sym_off += symlen) {
const char *name;
uint32_t name_off;