diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-02-21 06:43:20 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-02-21 06:46:11 -0800 |
commit | 8ecb73ddd7efde747f9b025cb624e378bc994db5 (patch) | |
tree | 27dd0ab0bbf1f9c051a710aa46edfbee6cafa12f /gas/write.c | |
parent | 95693d0804f33f3cce683cee1fb283e3e8fa558f (diff) | |
download | gdb-8ecb73ddd7efde747f9b025cb624e378bc994db5.zip gdb-8ecb73ddd7efde747f9b025cb624e378bc994db5.tar.gz gdb-8ecb73ddd7efde747f9b025cb624e378bc994db5.tar.bz2 |
Set BFD compression bits in write_object_file
There is no need to set BFD compression bits for each section. We
should just set it once in write_object_file.
* write.c (compress_debug): Move BFD compression bits setting
to ...
(write_object_file): Here.
Diffstat (limited to 'gas/write.c')
-rw-r--r-- | gas/write.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gas/write.c b/gas/write.c index 46d8d96..46ce5df 100644 --- a/gas/write.c +++ b/gas/write.c @@ -1433,14 +1433,12 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED) if (flag_compress_debug == COMPRESS_DEBUG_GABI_ZLIB) { - stdoutput->flags |= BFD_COMPRESS | BFD_COMPRESS_GABI; compression_header_size = bfd_get_compression_header_size (stdoutput, NULL); header_size = compression_header_size; } else { - stdoutput->flags |= BFD_COMPRESS; compression_header_size = 0; header_size = 12; } @@ -2216,7 +2214,13 @@ write_object_file (void) we start writing any sections, because it will affect the file layout, which is fixed once we start writing contents. */ if (flag_compress_debug) - bfd_map_over_sections (stdoutput, compress_debug, (char *) 0); + { + if (flag_compress_debug == COMPRESS_DEBUG_GABI_ZLIB) + stdoutput->flags |= BFD_COMPRESS | BFD_COMPRESS_GABI; + else + stdoutput->flags |= BFD_COMPRESS; + bfd_map_over_sections (stdoutput, compress_debug, (char *) 0); + } bfd_map_over_sections (stdoutput, write_contents, (char *) 0); } |