// mapfile.cc -- map file generation for gold
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright (C) 2008-2020 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
template<int size, bool big_endian>
void
Mapfile::print_input_section_symbols(
- const Sized_relobj<size, big_endian>* relobj,
+ const Sized_relobj_file<size, big_endian>* relobj,
unsigned int shndx)
{
unsigned int symcount = relobj->symbol_count();
}
char sizebuf[50];
+ section_size_type size;
+ if (!relobj->section_is_compressed(shndx, &size))
+ size = relobj->section_size(shndx);
snprintf(sizebuf, sizeof sizebuf, "0x%llx",
- static_cast<unsigned long long>(relobj->section_size(shndx)));
+ static_cast<unsigned long long>(size));
fprintf(this->map_file_, "0x%0*llx %10s %s\n",
parameters->target().get_size() / 4,
#ifdef HAVE_TARGET_32_LITTLE
case Parameters::TARGET_32_LITTLE:
{
- const Sized_relobj<32, false>* sized_relobj =
- static_cast<Sized_relobj<32, false>*>(relobj);
+ const Sized_relobj_file<32, false>* sized_relobj =
+ static_cast<Sized_relobj_file<32, false>*>(relobj);
this->print_input_section_symbols(sized_relobj, shndx);
}
break;
#ifdef HAVE_TARGET_32_BIG
case Parameters::TARGET_32_BIG:
{
- const Sized_relobj<32, true>* sized_relobj =
- static_cast<Sized_relobj<32, true>*>(relobj);
+ const Sized_relobj_file<32, true>* sized_relobj =
+ static_cast<Sized_relobj_file<32, true>*>(relobj);
this->print_input_section_symbols(sized_relobj, shndx);
}
break;
#ifdef HAVE_TARGET_64_LITTLE
case Parameters::TARGET_64_LITTLE:
{
- const Sized_relobj<64, false>* sized_relobj =
- static_cast<Sized_relobj<64, false>*>(relobj);
+ const Sized_relobj_file<64, false>* sized_relobj =
+ static_cast<Sized_relobj_file<64, false>*>(relobj);
this->print_input_section_symbols(sized_relobj, shndx);
}
break;
#ifdef HAVE_TARGET_64_BIG
case Parameters::TARGET_64_BIG:
{
- const Sized_relobj<64, true>* sized_relobj =
- static_cast<Sized_relobj<64, true>*>(relobj);
+ const Sized_relobj_file<64, true>* sized_relobj =
+ static_cast<Sized_relobj_file<64, true>*>(relobj);
this->print_input_section_symbols(sized_relobj, shndx);
}
break;
char sizebuf[50];
snprintf(sizebuf, sizeof sizebuf, "0x%llx",
- static_cast<unsigned long long>(od->data_size()));
+ static_cast<unsigned long long>(od->current_data_size()));
fprintf(this->map_file_, "0x%0*llx %10s\n",
parameters->target().get_size() / 4,
- static_cast<unsigned long long>(od->address()),
+ (od->is_address_valid()
+ ? static_cast<unsigned long long>(od->address())
+ : 0),
sizebuf);
}
char sizebuf[50];
snprintf(sizebuf, sizeof sizebuf, "0x%llx",
- static_cast<unsigned long long>(os->data_size()));
+ static_cast<unsigned long long>(os->current_data_size()));
fprintf(this->map_file_, "0x%0*llx %10s",
parameters->target().get_size() / 4,
parameters->target().get_size() / 4,
static_cast<unsigned long long>(os->load_address()));
+ if (os->requires_postprocessing())
+ fprintf(this->map_file_, " (before compression)");
+
putc('\n', this->map_file_);
}