summaryrefslogtreecommitdiff
path: root/bfd/bfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/bfd.c')
-rw-r--r--bfd/bfd.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/bfd/bfd.c b/bfd/bfd.c
index f56a8d342fb..7e3aeb535f3 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -2338,8 +2338,6 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents,
bfd_put_32 (abfd, sec->size, &echdr->ch_size);
bfd_put_32 (abfd, 1 << sec->alignment_power,
&echdr->ch_addralign);
- /* bfd_log2 (alignof (Elf32_Chdr)) */
- bfd_set_section_alignment (abfd, sec, 2);
}
else
{
@@ -2350,8 +2348,6 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents,
bfd_put_64 (abfd, sec->size, &echdr->ch_size);
bfd_put_64 (abfd, 1 << sec->alignment_power,
&echdr->ch_addralign);
- /* bfd_log2 (alignof (Elf64_Chdr)) */
- bfd_set_section_alignment (abfd, sec, 3);
}
}
else
@@ -2364,8 +2360,6 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents,
order. */
memcpy (contents, "ZLIB", 4);
bfd_putb64 (sec->size, contents + 4);
- /* No way to keep the original alignment, just use 1 always. */
- bfd_set_section_alignment (abfd, sec, 0);
}
}
}
@@ -2380,14 +2374,12 @@ bfd_update_compression_header (bfd *abfd, bfd_byte *contents,
SYNOPSIS
bfd_boolean bfd_check_compression_header
(bfd *abfd, bfd_byte *contents, asection *sec,
- bfd_size_type *uncompressed_size,
- unsigned int *uncompressed_alignment_power);
+ bfd_size_type *uncompressed_size);
DESCRIPTION
Check the compression header at CONTENTS of SEC in ABFD and
- store the uncompressed size in UNCOMPRESSED_SIZE and the
- uncompressed data alignment in UNCOMPRESSED_ALIGNMENT_POWER
- if the compression header is valid.
+ store the uncompressed size in UNCOMPRESSED_SIZE if the
+ compression header is valid.
RETURNS
Return TRUE if the compression header is valid.
@@ -2396,8 +2388,7 @@ RETURNS
bfd_boolean
bfd_check_compression_header (bfd *abfd, bfd_byte *contents,
asection *sec,
- bfd_size_type *uncompressed_size,
- unsigned int *uncompressed_alignment_power)
+ bfd_size_type *uncompressed_size)
{
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
&& (elf_section_flags (sec) & SHF_COMPRESSED) != 0)
@@ -2419,10 +2410,9 @@ bfd_check_compression_header (bfd *abfd, bfd_byte *contents,
chdr.ch_addralign = bfd_get_64 (abfd, &echdr->ch_addralign);
}
if (chdr.ch_type == ELFCOMPRESS_ZLIB
- && chdr.ch_addralign == (1U << bfd_log2 (chdr.ch_addralign)))
+ && chdr.ch_addralign == 1U << sec->alignment_power)
{
*uncompressed_size = chdr.ch_size;
- *uncompressed_alignment_power = bfd_log2 (chdr.ch_addralign);
return TRUE;
}
}