diff options
author | Ian Lance Taylor <ian@airs.com> | 1993-10-11 21:40:10 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1993-10-11 21:40:10 +0000 |
commit | f37449aaf3d3e3f611a02a7fa7a4642cbc47e658 (patch) | |
tree | ec110296f814ad031c0e69c32794fb35bb62cecd /gas/config/obj-ecoff.c | |
parent | a7853216049cb473f62ff8196151829edef76ad8 (diff) | |
download | gdb-f37449aaf3d3e3f611a02a7fa7a4642cbc47e658.zip gdb-f37449aaf3d3e3f611a02a7fa7a4642cbc47e658.tar.gz gdb-f37449aaf3d3e3f611a02a7fa7a4642cbc47e658.tar.bz2 |
* write.c (write_contents): Don't crash if seginfo is NULL.
* config/obj-ecoff.c (ecoff_frob_file): Write out register masks
by modifying .reginfo section, not by directly modifying BFD
backend data.
Diffstat (limited to 'gas/config/obj-ecoff.c')
-rw-r--r-- | gas/config/obj-ecoff.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/gas/config/obj-ecoff.c b/gas/config/obj-ecoff.c index 5e66e3a..9d5a913 100644 --- a/gas/config/obj-ecoff.c +++ b/gas/config/obj-ecoff.c @@ -4605,16 +4605,33 @@ ecoff_frob_file () #undef SET + /* Fill in the register masks. */ + { + asection *regsec; + struct ecoff_reginfo s; + + regsec = bfd_make_section (stdoutput, REGINFO); + know (regsec != NULL); + + if (bfd_get_section_contents (stdoutput, regsec, (PTR) &s, + (file_ptr) 0, sizeof s) == false) + as_fatal ("Can't read REGINFO section"); + #ifdef TC_MIPS - /* Get the MIPS register masks. It's probably not worth setting up - a generic interface for this. */ - ecoff_data (stdoutput)->gprmask = mips_gprmask; - ecoff_data (stdoutput)->cprmask[0] = mips_cprmask[0]; - ecoff_data (stdoutput)->cprmask[1] = mips_cprmask[1]; - ecoff_data (stdoutput)->cprmask[2] = mips_cprmask[2]; - ecoff_data (stdoutput)->cprmask[3] = mips_cprmask[3]; + /* Fill in the MIPS register masks. It's probably not worth + setting up a generic interface for this. */ + s.gprmask = mips_gprmask; + s.cprmask[0] = mips_cprmask[0]; + s.cprmask[1] = mips_cprmask[1]; + s.cprmask[2] = mips_cprmask[2]; + s.cprmask[3] = mips_cprmask[3]; #endif + if (bfd_set_section_contents (stdoutput, regsec, (PTR) &s, + (file_ptr) 0, sizeof s) == false) + as_fatal ("Can't write REGINFO section"); + } + ecoff_data (stdoutput)->raw_size = offset; ecoff_data (stdoutput)->raw_syments = buf; |