Sourceware Bugzilla – Attachment 15240 Details for
Bug 31115
[ARM] The minimalistic DWARF DIE for function has wrong address in Thumb mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
pr31115.patch (text/plain), 2.57 KB, created by
Nick Clifton
on 2023-12-06 14:23:22 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Nick Clifton
Created:
2023-12-06 14:23:22 UTC
Size:
2.57 KB
patch
obsolete
>diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h >index 9d6b303842b..9099e87e88d 100644 >--- a/gas/config/tc-arm.h >+++ b/gas/config/tc-arm.h >@@ -387,3 +387,14 @@ extern bool arm_tc_equal_in_insn (int, char *); > #define TC_LARGEST_EXPONENT_IS_NORMAL(PRECISION) \ > arm_is_largest_exponent_ok ((PRECISION)) > int arm_is_largest_exponent_ok (int precision); >+ >+/* PR 31115: When creating an expression in a DWARF section involving a thumb >+ function symbol make sure that we allow for the bottom bit being set. */ >+#define TC_DWARF_SYM_EXPR_ADJUST(exp) \ >+ do \ >+ { \ >+ if (exp.X_add_symbol != NULL \ >+ && THUMB_IS_FUNC (exp.X_add_symbol)) \ >+ exp.X_add_number--; \ >+ } \ >+ while (0) >diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi >index 3eea25b758c..cd58f122cd4 100644 >--- a/gas/doc/internals.texi >+++ b/gas/doc/internals.texi >@@ -1562,6 +1562,15 @@ The function should return the debug format that is preferred by the CPU > backend. This format will be used when generating assembler specific debug > information. > >+@item TC_DWARF_SYM_EXPR_ADJUST (@var{exp}) >+@cindex TC_DWARF_SYM_EXPR_ADJUST >+If defined this macro allows the backend a chance to modify an expression >+involving a symbol, when the expression is going to be evaluated or converted >+into a relocation for an entry in a DWARF section. >+ >+The ARM backend for example uses this macro to remove the special encoding of >+thumb function addresses before they are emitted into a DWARF DIE. >+ > @item md_emit_single_noop_insn > @itemx md_single_noop_insn > These macro facilitate the @var{.nop} directive. If defined the >diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c >index 331264b1f6f..f6923c7b51b 100644 >--- a/gas/dwarf2dbg.c >+++ b/gas/dwarf2dbg.c >@@ -248,6 +248,10 @@ static unsigned int sizeof_address; > #ifndef TC_DWARF2_EMIT_OFFSET > #define TC_DWARF2_EMIT_OFFSET generic_dwarf2_emit_offset > >+#ifndef TC_DWARF_SYM_EXPR_ADJUST >+#define TC_DWARF_SYM_EXPR_ADJUST(exp) >+#endif >+ > /* Create an offset to .dwarf2_*. */ > > static void >@@ -2981,6 +2985,7 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT str_seg, > exp.X_op = O_symbol; > exp.X_add_symbol = symp; > exp.X_add_number = 0; >+ TC_DWARF_SYM_EXPR_ADJUST (exp); > emit_expr (&exp, sizeof_address); > > /* DW_AT_high_pc */ >@@ -2989,6 +2994,7 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT str_seg, > if (size.X_op == O_constant) > size.X_op = O_symbol; > size.X_add_symbol = symp; >+ TC_DWARF_SYM_EXPR_ADJUST (size); > emit_expr (&size, sizeof_address); > } > else if (size.X_op == O_constant)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 31115
: 15240 |
15249