summaryrefslogtreecommitdiff
path: root/bfd/compress.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2011-04-11 04:08:07 +0000
committerAlan Modra <amodra@bigpond.net.au>2011-04-11 04:08:07 +0000
commit5c46a0a5b7a65f8277e45977e1de105f734ca0ec (patch)
tree7a664621c355570d4272786dec7f475e11efe205 /bfd/compress.c
parent8f9ea7c84beaec51b2a4dff4fece6ef8114e90cd (diff)
downloadgdb-5c46a0a5b7a65f8277e45977e1de105f734ca0ec.tar.gz
* bfd-in.h (bfd_get_section_limit): Don't use rawsize with output
sections. * libbfd.c (_bfd_generic_get_section_contents): Likewise. (_bfd_generic_get_section_contents_in_window): Likewise. * section.c (bfd_get_section_contents): Likewise. * compress.c (bfd_get_full_section_contents): Likewise. * elf32-rx.c (rx_final_link): Ignore rawsize. * elf32-microblaze.c (microblaze_elf_relocate_section): Use correct bfd with bfd_get_section_limit. * elfxx-ia64.c (elfNN_ia64_choose_gp): Add "final" parameter. Use os->size during final link. Update callers. * bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd/compress.c')
-rw-r--r--bfd/compress.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bfd/compress.c b/bfd/compress.c
index 669033c5ec5..a82a8bc9e3c 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -1,5 +1,5 @@
/* Compressed section support (intended for debug sections).
- Copyright 2008, 2010
+ Copyright 2008, 2010, 2011
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -158,7 +158,7 @@ DESCRIPTION
bfd_boolean
bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
{
- bfd_size_type sz = sec->rawsize ? sec->rawsize : sec->size;
+ bfd_size_type sz;
bfd_byte *p = *ptr;
#ifdef HAVE_ZLIB_H
bfd_boolean ret;
@@ -169,6 +169,10 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
bfd_byte *uncompressed_buffer;
#endif
+ if (abfd->direction != write_direction && sec->rawsize != 0)
+ sz = sec->rawsize;
+ else
+ sz = sec->size;
if (sz == 0)
return TRUE;