X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gold%2Foutput.cc;h=df80587e666d36592747ace913f26c010ee180ce;hb=abdb711e0855f0597a96db0486b598144b788212;hp=0a34a2af21e3258b9a70eae3be6232b0b1f5cd67;hpb=219d1afa89d0d53ca93a684cac341f16470f3ca0;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/output.cc b/gold/output.cc index 0a34a2af21..df80587e66 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -1,6 +1,6 @@ // output.cc -- manage the output file for gold -// Copyright (C) 2006-2018 Free Software Foundation, Inc. +// Copyright (C) 2006-2019 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -2395,7 +2395,8 @@ Output_section::Output_section(const char* name, elfcpp::Elf_Word type, lookup_maps_(new Output_section_lookup_maps), free_list_(), free_space_fill_(NULL), - patch_space_(0) + patch_space_(0), + reloc_section_(NULL) { // An unallocated section has no address. Forcing this means that // we don't need special treatment for symbols defined in debug @@ -2447,7 +2448,13 @@ Output_section::add_input_section(Layout* layout, unsigned int reloc_shndx, bool have_sections_script) { + section_size_type input_section_size = shdr.get_sh_size(); + section_size_type uncompressed_size; elfcpp::Elf_Xword addralign = shdr.get_sh_addralign(); + if (object->section_is_compressed(shndx, &uncompressed_size, + &addralign)) + input_section_size = uncompressed_size; + if ((addralign & (addralign - 1)) != 0) { object->error(_("invalid alignment %lu for section \"%s\""), @@ -2497,11 +2504,6 @@ Output_section::add_input_section(Layout* layout, } } - section_size_type input_section_size = shdr.get_sh_size(); - section_size_type uncompressed_size; - if (object->section_is_compressed(shndx, &uncompressed_size)) - input_section_size = uncompressed_size; - off_t offset_in_section; if (this->has_fixed_layout())