Copy BFD_COMPRESS/BFD_DECOMPRESS/BFD_COMPRESS_GABI for thin archive
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 30 Aug 2019 14:46:15 +0000 (07:46 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 30 Aug 2019 14:46:27 +0000 (07:46 -0700)
We need to copy BFD_COMPRESS, BFD_DECOMPRESS and BFD_COMPRESS_GABI flags
for thin archive.

PR ld/24951
* archive.c (_bfd_get_elt_at_filepos): Copy BFD_COMPRESS,
BFD_DECOMPRESS and BFD_COMPRESS_GABI flags for thin archive.

bfd/ChangeLog
bfd/archive.c

index d292e87f56ba1368cfa671b90f08eab30e859252..bb99231c64469f251ed341952657f3844a720007 100644 (file)
@@ -1,3 +1,9 @@
+2019-08-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/24951
+       * archive.c (_bfd_get_elt_at_filepos): Copy BFD_COMPRESS,
+       BFD_DECOMPRESS and BFD_COMPRESS_GABI flags for thin archive.
+
 2019-08-29  Alan Modra  <amodra@gmail.com>
 
        PR 24697
index 3baf83d40ca18689283b4132468d72c1835aa7f4..690718e9494cae9cb552d6428e1c3109bcf3a4dd 100644 (file)
@@ -692,6 +692,13 @@ _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos)
              return NULL;
            }
          n_bfd->proxy_origin = bfd_tell (archive);
+
+         /* Copy BFD_COMPRESS, BFD_DECOMPRESS and BFD_COMPRESS_GABI
+            flags.  */
+         n_bfd->flags |= archive->flags & (BFD_COMPRESS
+                                           | BFD_DECOMPRESS
+                                           | BFD_COMPRESS_GABI);
+
          return n_bfd;
        }