Skip to content

Commit

Permalink
kern/symbols: No need for a separate .symbol_table section
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed May 21, 2024
1 parent 0fc0127 commit 60fba64
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
5 changes: 2 additions & 3 deletions kernel/c/symbol_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
#include <stdint.h>
#include <symbols.h>

__attribute__((section(".symbol_table")))
struct symbol symbol_table[] = {
const struct symbol symbol_table[] = {
{0xffffffffffffffff, ""}
};

struct symbol *get_symbol_table(void) {
const struct symbol *get_symbol_table(void) {
return symbol_table;
}
2 changes: 1 addition & 1 deletion kernel/c/symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ struct symbol {
char *string;
};

struct symbol *get_symbol_table(void);
const struct symbol *get_symbol_table(void);

#endif
5 changes: 2 additions & 3 deletions kernel/gensyms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ struct symbol {
char *string;
};
__attribute__((section(".symbol_table")))
struct symbol symbol_table[] = {
const struct symbol symbol_table[] = {
EOF

paste -d'$' "$TMP2" "$TMP3" | sed "s/^/ {0x/g;s/\\\$/, \"/g;s/\$/\"},/g"
Expand All @@ -47,7 +46,7 @@ cat <<EOF
{0xffffffffffffffff, ""}
};
struct symbol *get_symbol_table(void) {
const struct symbol *get_symbol_table(void) {
return symbol_table;
}
EOF
Expand Down
4 changes: 0 additions & 4 deletions kernel/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ SECTIONS
*(.rodata .rodata.*)
} :rodata

.symbol_table : {
*(.symbol_table)
} :rodata

rodata_end = .;

/* Move to the next memory page for .data */
Expand Down

0 comments on commit 60fba64

Please sign in to comment.