aboutsummaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-04-06 10:56:30 +0200
committerJan Beulich <jbeulich@suse.com>2021-04-06 10:56:30 +0200
commitda0835aebea71232f6b4fb4dea3ee18bdef0c139 (patch)
tree2313316a06212ece07aa8c89e12311528315519d /gas/write.c
parentbd3d1480a80effbbf3eedf1bd51368730ec9078d (diff)
downloadgdb-da0835aebea71232f6b4fb4dea3ee18bdef0c139.zip
gdb-da0835aebea71232f6b4fb4dea3ee18bdef0c139.tar.gz
gdb-da0835aebea71232f6b4fb4dea3ee18bdef0c139.tar.bz2
gas: missing (re-)initialization of local variable in fixup_segment()
At the very least this has been causing bogus diagnostics, e.g. .text .data .long .bss - . .long -.text .bss yielding Error: can't resolve `0' {.bss section} - `.text' {.text section} instead of Error: can't resolve `0' {*ABS* section} - `.text' {.text section} In particular for targets overriding any of TC_FORCE_RELOCATION_* & Co or for ones setting md_register_arithmetic to true the problems may be worse.
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gas/write.c b/gas/write.c
index c8e6ab4..706c9c0 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -922,7 +922,6 @@ fixup_segment (fixS *fixP, segT this_segment)
{
valueT add_number;
fragS *fragP;
- segT add_symbol_segment = absolute_section;
if (fixP != NULL && abs_section_sym == NULL)
abs_section_sym = section_symbol (absolute_section);
@@ -953,6 +952,8 @@ fixup_segment (fixS *fixP, segT this_segment)
for (; fixP; fixP = fixP->fx_next)
{
+ segT add_symbol_segment = absolute_section;
+
#ifdef DEBUG5
fprintf (stderr, "\nprocessing fixup:\n");
print_fixup (fixP);