On Tue, Apr 01, 2025 at 10:53:46AM -0700, Guenter Roeck wrote:
#define _BUG_FLAGS(ins, flags, extra) \ do { \ asm_inline volatile("1:\t" ins "\n" \ ".pushsection __bug_table,"aw"\n" \ "2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n" \ "\t" __BUG_REL(%c0) "\t# bug_entry::file\n" \
"\t.word %c1" "\t# bug_entry::line\n" \
"\t.word %c2" "\t# bug_entry::flags\n" \
"\t.org 2b+%c3\n" \
"\t" __BUG_FUNC_PTR "\t# bug_entry::function\n" \
"\t.word %c2" "\t# bug_entry::line\n" \
"\t.word %c3" "\t# bug_entry::flags\n" \
"\t.org 2b+%c4\n" \ ".popsection\n" \ extra \
: : "i" (__FILE__), "i" (__LINE__), \
} while (0): : "i" (__FILE__), "i" (__BUG_FUNC), "i" (__LINE__),\ "i" (flags), \ "i" (sizeof(struct bug_entry))); \
Also this, why do you need this extra function in the bug entry? Isn't that trivial from the trap site itself? symbol information should be able to get you the function from the trap ip.
None of this makes any sense.