Skip to content

Commit a752782

Browse files
committed
Merge tag 'rust-fixes-6.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux
Pull Rust fix from Miguel Ojeda: - Fix a Rust 1.91.0 build issue due to 'bindings.o' not containing DWARF debug information anymore by teaching gendwarfksyms to skip object files without exports * tag 'rust-fixes-6.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux: gendwarfksyms: Skip files with no exports
2 parents 1cc41c8 + fdf302e commit a752782

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

scripts/gendwarfksyms/gendwarfksyms.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ int main(int argc, char **argv)
138138
error("no input files?");
139139
}
140140

141-
symbol_read_exports(stdin);
141+
if (!symbol_read_exports(stdin))
142+
return 0;
142143

143144
if (symtypes_file) {
144145
symfile = fopen(symtypes_file, "w");

scripts/gendwarfksyms/gendwarfksyms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ struct symbol {
123123
typedef void (*symbol_callback_t)(struct symbol *, void *arg);
124124

125125
bool is_symbol_ptr(const char *name);
126-
void symbol_read_exports(FILE *file);
126+
int symbol_read_exports(FILE *file);
127127
void symbol_read_symtab(int fd);
128128
struct symbol *symbol_get(const char *name);
129129
void symbol_set_ptr(struct symbol *sym, Dwarf_Die *ptr);

scripts/gendwarfksyms/symbols.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static bool is_exported(const char *name)
128128
return for_each(name, NULL, NULL) > 0;
129129
}
130130

131-
void symbol_read_exports(FILE *file)
131+
int symbol_read_exports(FILE *file)
132132
{
133133
struct symbol *sym;
134134
char *line = NULL;
@@ -159,6 +159,8 @@ void symbol_read_exports(FILE *file)
159159

160160
free(line);
161161
debug("%d exported symbols", nsym);
162+
163+
return nsym;
162164
}
163165

164166
static void get_symbol(struct symbol *sym, void *arg)

0 commit comments

Comments
 (0)