diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-08-08 21:41:30 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-08-08 21:41:30 +0000 |
commit | 1356d77df3d5860b008035d6ad2f4f1f7093b0fe (patch) | |
tree | d866efd6be56cdd01d68b15d4c1e94755dfff025 /gas/config/obj-coff.c | |
parent | 7aaec27bc740ff6c5a1377744ec0faac6edca74a (diff) | |
download | gdb-1356d77df3d5860b008035d6ad2f4f1f7093b0fe.zip gdb-1356d77df3d5860b008035d6ad2f4f1f7093b0fe.tar.gz gdb-1356d77df3d5860b008035d6ad2f4f1f7093b0fe.tar.bz2 |
* struc-symbol.h (struct symbol): Add sy_mri_common bit.
* read.h (mri_comon_symbol): Declare.
(s_mri_common): Declare.
* read.c (mri_line_label): New static variable.
(mri_common_symbol): New global variable.
(potable): Add "common" and "common.s".
(read_a_source_file): In MRI mode, set mri_line_label for a label
at the start of a line.
(s_mri_common): New function.
(s_space): Handle mri_common_symbol.
* symbols.c (colon): Change return value from void to symbolS *,
and return new symbol. If mri_common_symbol is set, attach the
new symbol to it.
(resolve_symbol_value): Handle an sy_mri_common symbol.
* symbols.h (colon): Change return value in declaration.
* subsegs.c (subseg_set_rest): Clear mri_common_symbol.
(subseg_set (both versions)): Likewise.
* frags.c (frag_more): Warn if mri_common_symbol is not NULL.
* write.c (adjust_reloc_syms): Skip sy_mri_common symbols.
(write_object_file): Discard sy_mri_common symbols.
(fixup_segment): Change relocations against sy_mri_common symbols
to be against the common symbol itself.
* config/obj-coff.c (yank_symbols): Discard sy_mri_common symbols.
(fixup_segment): Change relocations against sy_mri_common symbols
to be against the common symbol itself.
* config/obj-aout.c (obj_crawl_symbol_chain): Discard
sy_mri_common symbols.
Diffstat (limited to 'gas/config/obj-coff.c')
-rw-r--r-- | gas/config/obj-coff.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index 11a5daa..b48900b 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -2481,6 +2481,15 @@ yank_symbols () symbolP; symbolP = symbolP ? symbol_next (symbolP) : symbol_rootP) { + if (symbolP->sy_mri_common) + { + if (S_GET_STORAGE_CLASS (symbolP) == C_EXT) + as_bad ("%s: global symbols not supported in common sections", + S_GET_NAME (symbolP)); + symbol_remove (symbolP, &symbol_rootP, &symbol_lastP); + continue; + } + if (!SF_GET_DEBUG (symbolP)) { /* Debug symbols do not need all this rubbish */ @@ -3593,7 +3602,7 @@ fixup_segment (segP, this_segment_type) register fixS * fixP; register symbolS *add_symbolP; register symbolS *sub_symbolP; - register long add_number; + long add_number; register int size; register char *place; register long where; @@ -3632,6 +3641,14 @@ fixup_segment (segP, this_segment_type) add_number = fixP->fx_offset; pcrel = fixP->fx_pcrel; + if (add_symbolP->sy_mri_common) + { + know (add_symbolP->sy_value.X_op == O_symbol); + add_number += S_GET_VALUE (add_symbolP); + fixP->fx_offset = add_number; + add_symbolP = fixP->fx_addsy = add_symbolP->sy_value.X_add_symbol; + } + if (add_symbolP) { add_symbol_segment = S_GET_SEGMENT (add_symbolP); @@ -3680,6 +3697,10 @@ fixup_segment (segP, this_segment_type) fixP->fx_addsy = NULL; fixP->fx_subsy = NULL; fixP->fx_done = 1; +#ifdef TC_M68K /* is this right? */ + pcrel = 0; + fixP->fx_pcrel = 0; +#endif } } else |