/* Mark flag used by some linker backends for garbage collection. */
unsigned int gc_mark : 1;
+ /* Section compression status. */
+ unsigned int compress_status : 2;
+#define COMPRESS_SECTION_NONE 0
+#define COMPRESS_SECTION_DONE 1
+#define DECOMPRESS_SECTION_SIZED 2
+
/* The following flags are used by the ELF linker. */
/* Mark sections which have been allocated to segments. */
section size calculated on a previous linker relaxation pass. */
bfd_size_type rawsize;
+ /* The compressed size of the section in octets. */
+ bfd_size_type compressed_size;
+
/* Relaxation table. */
struct relax_table *relax;
/* name, id, index, next, prev, flags, user_set_vma, */ \
{ NAME, IDX, 0, NULL, NULL, FLAGS, 0, \
\
- /* linker_mark, linker_has_input, gc_mark, segment_mark, */ \
+ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \
0, 0, 1, 0, \
\
- /* sec_info_type, use_rela_p, */ \
- 0, 0, \
+ /* segment_mark, sec_info_type, use_rela_p, */ \
+ 0, 0, 0, \
\
/* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \
0, 0, 0, 0, 0, 0, \
\
- /* vma, lma, size, rawsize, relax, relax_count, */ \
- 0, 0, 0, 0, 0, 0, \
+ /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \
+ 0, 0, 0, 0, 0, 0, 0, \
\
/* output_offset, output_section, alignment_power, */ \
0, (struct bfd_section *) &SEC, 0, \
will be consistent from run to run. */
#define BFD_DETERMINISTIC_OUTPUT 0x4000
+ /* Compress sections in this BFD. */
+#define BFD_COMPRESS 0x8000
+
+ /* Decompress sections in this BFD. */
+#define BFD_DECOMPRESS 0x10000
+
+ /* Flags bits to be saved in bfd_preserve_save. */
+#define BFD_FLAGS_SAVED \
+ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS)
+
/* Currently my_archive is tested before adding origin to
anything. I believe that this can become always an add of
origin, with origin set to 0 for non archive files. */
(bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
/* Extracted from compress.c. */
-bfd_boolean bfd_uncompress_section_contents
- (bfd_byte **buffer, bfd_size_type *size);
+bfd_boolean bfd_compress_section_contents
+ (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer,
+ bfd_size_type uncompressed_size);
+
+bfd_boolean bfd_get_full_section_contents
+ (bfd *abfd, asection *section, bfd_byte **ptr);
+
+bfd_boolean bfd_is_section_compressed
+ (bfd *abfd, asection *section);
+
+bfd_boolean bfd_init_section_decompress_status
+ (bfd *abfd, asection *section);
+
+bfd_boolean bfd_init_section_compress_status
+ (bfd *abfd, asection *section);
#ifdef __cplusplus
}