summaryrefslogtreecommitdiff
path: root/gas/subsegs.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2004-07-19 19:15:43 +0000
committerH.J. Lu <hjl@lucon.org>2004-07-19 19:15:43 +0000
commitd67260fc9e09ebd0a28988e3e664a8778ee90182 (patch)
tree70570435724ade2332c55019a72ef92b79462312 /gas/subsegs.c
parentcffbe22af8a6f1bb8974101616f19125591e9c5d (diff)
downloadbinutils-redhat-d67260fc9e09ebd0a28988e3e664a8778ee90182.tar.gz
2004-07-19 Christopher Faylor <cgf@timesys.com>
H.J. Lu <hongjiu.lu@intel.com> * subsegs.c (section_symbol): Don't create a new segment when existing segment is undefined.
Diffstat (limited to 'gas/subsegs.c')
-rw-r--r--gas/subsegs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gas/subsegs.c b/gas/subsegs.c
index 9e46cfe341..8b0679cbc4 100644
--- a/gas/subsegs.c
+++ b/gas/subsegs.c
@@ -523,18 +523,18 @@ section_symbol (segT sec)
}
else
{
+ segT seg;
s = symbol_find_base (sec->symbol->name, 0);
/* We have to make sure it is the right symbol when we
have multiple sections with the same section name. */
- if (s == NULL || S_GET_SEGMENT (s) != sec)
+ if (s == NULL
+ || ((seg = S_GET_SEGMENT (s)) != sec
+ && seg != undefined_section))
s = symbol_new (sec->symbol->name, sec, 0, &zero_address_frag);
- else
+ else if (seg == undefined_section)
{
- if (S_GET_SEGMENT (s) == undefined_section)
- {
- S_SET_SEGMENT (s, sec);
- symbol_set_frag (s, &zero_address_frag);
- }
+ S_SET_SEGMENT (s, sec);
+ symbol_set_frag (s, &zero_address_frag);
}
}