aboutsummaryrefslogtreecommitdiff
path: root/bfd/mmo.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@bitrange.com>2015-10-20 06:56:33 +0200
committerHans-Peter Nilsson <hp@bitrange.com>2015-10-20 06:56:33 +0200
commitf9c62303d87da9c766ca67d01f602130c2777951 (patch)
tree191b77817e0bdc8666b0ae554f908f0c51171d61 /bfd/mmo.c
parentbfd09d203fe1eda11ef2c7a500ad1d21eae32bc0 (diff)
downloadgdb-f9c62303d87da9c766ca67d01f602130c2777951.zip
gdb-f9c62303d87da9c766ca67d01f602130c2777951.tar.gz
gdb-f9c62303d87da9c766ca67d01f602130c2777951.tar.bz2
Correct printed value of Main in mmo.c consistency error message.
Diffstat (limited to 'bfd/mmo.c')
-rw-r--r--bfd/mmo.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bfd/mmo.c b/bfd/mmo.c
index b269ffb..484a370 100644
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -2896,16 +2896,17 @@ mmo_write_symbols_and_terminator (bfd *abfd)
&& (table[i]->flags & (BSF_DEBUGGING|BSF_GLOBAL)) == BSF_GLOBAL)
{
asymbol *mainsym = table[i];
- memcpy (table + 1, orig_table, i * sizeof (asymbol *));
+ bfd_vma mainvalue
+ = (mainsym->value
+ + mainsym->section->output_section->vma
+ + mainsym->section->output_offset);
+ memcpy (table + 1, orig_table, i * sizeof (asymbol *));
table[0] = mainsym;
/* Check that the value assigned to :Main is the same as the entry
address. The default linker script asserts this. This is as
good a place as any to check this consistency. */
- if ((mainsym->value
- + mainsym->section->output_section->vma
- + mainsym->section->output_offset)
- != bfd_get_start_address (abfd))
+ if (mainvalue != bfd_get_start_address (abfd))
{
/* Arbitrary buffer to hold the printable representation of a
vma. */
@@ -2913,7 +2914,7 @@ mmo_write_symbols_and_terminator (bfd *abfd)
char vmas_start[40];
bfd_vma vma_start = bfd_get_start_address (abfd);
- sprintf_vma (vmas_main, mainsym->value);
+ sprintf_vma (vmas_main, mainvalue);
sprintf_vma (vmas_start, vma_start);
(*_bfd_error_handler)