diff options
author | Nick Clifton <nickc@redhat.com> | 2019-07-02 14:14:13 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2019-07-02 14:14:13 +0100 |
commit | 125f83f66c10c89530d011f4f81324b1f43afcda (patch) | |
tree | fbe8efe47110bf9b0c6a07a225839ac3cf83d197 /bfd/compress.c | |
parent | 163b2c58bdbf0cba9a085574ae88d4c757c6567d (diff) | |
download | gdb-125f83f66c10c89530d011f4f81324b1f43afcda.zip gdb-125f83f66c10c89530d011f4f81324b1f43afcda.tar.gz gdb-125f83f66c10c89530d011f4f81324b1f43afcda.tar.bz2 |
Fix a bug recently introduced to the linker where it would complain about a section being larger than a file, even if the section was artificial.
PR 24753
bfd * compress.c (bfd_get_full_section_contents): Do not complain
about linker created sections that are larger than the file size.
ld * emultempl/aarch64elf.em (_aarch64_add_stub_section): Include the
LINKER_CREATED section flag when creating the stub section.
Diffstat (limited to 'bfd/compress.c')
-rw-r--r-- | bfd/compress.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/compress.c b/bfd/compress.c index cba281d..32de099 100644 --- a/bfd/compress.c +++ b/bfd/compress.c @@ -253,6 +253,9 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) ufile_ptr filesize = bfd_get_file_size (abfd); if (filesize > 0 && filesize < sz + /* PR 24753: Linker created sections can be larger than + the file size, eg if they are being used to hold stubs. */ + && (bfd_get_section_flags (abfd, sec) & SEC_LINKER_CREATED) == 0 /* The MMO file format supports its own special compression technique, but it uses COMPRESS_SECTION_NONE when loading a section's contents. */ |