diff options
author | Jeff Law <law@redhat.com> | 1994-04-11 16:11:12 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1994-04-11 16:11:12 +0000 |
commit | caed9e8251b3f6b2f7f86168755535632e755aa7 (patch) | |
tree | a4896474a8dd7c6caedcc2654f9b86fa05343fde /gas/config | |
parent | 61b3c2c58b7c70f2c8a03b9b4a21855051303f60 (diff) | |
download | gdb-caed9e8251b3f6b2f7f86168755535632e755aa7.zip gdb-caed9e8251b3f6b2f7f86168755535632e755aa7.tar.gz gdb-caed9e8251b3f6b2f7f86168755535632e755aa7.tar.bz2 |
* config/tc-hppa.c (pa_procend): Handle case where label was
defined after the .proc directive.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-hppa.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index e6b17e2..60e9b7b 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -5008,8 +5008,43 @@ pa_procend (unused) int unused; { - if (last_call_info->start_symbol == NULL) - as_bad ("Missing function name for .PROC"); + /* If we are within a procedure definition, make sure we've + defined a label for the procedure; handle case where the + label was defined after the .PROC directive. + + Note there's not need to diddle with the segment or fragment + for the label symbol in this case. We have already switched + into the new $CODE$ subspace at this point. */ + if (within_procedure && last_call_info->start_symbol == NULL) + { + label_symbol_struct *label_symbol = pa_get_label (); + + if (label_symbol) + { + if (label_symbol->lss_label) + { + last_call_info->start_symbol = label_symbol->lss_label; + label_symbol->lss_label->bsym->flags |= BSF_FUNCTION; +#ifdef OBJ_SOM + /* Also handle allocation of a fixup to hold the unwind + information when the label appears after the proc/procend. */ + if (within_entry_exit) + { + char *where = frag_more (0); + + fix_new_hppa (frag_now, where - frag_now->fr_literal, 0, + last_call_info->start_symbol, (offsetT) 0, NULL, + 0, R_HPPA_ENTRY, e_fsel, 0, 0, + (char *) &last_call_info->ci_unwind.descriptor); + } +#endif + } + else + as_bad ("Missing function name for .PROC (corrupted label chain)"); + } + else + as_bad ("Missing function name for .PROC"); + } if (!within_procedure) as_bad ("misplaced .procend"); |