[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/11219] LMA in link map versus object file disagrees
From: |
sterling at tensilica dot com |
Subject: |
[Bug ld/11219] LMA in link map versus object file disagrees |
Date: |
2 Feb 2010 22:51:17 -0000 |
------- Additional Comments From sterling at tensilica dot com 2010-02-02
22:51 -------
How about the following patch, which simply ensures that the bfd section's lma
isn't stale? A warning is not helpful in my particular case, and no one else
seems to care, so not warning is OK with me, but it could issue a warning also
if that seems the right thing to do.
--- bfd/elf.c 2 Feb 2010 12:37:39 -0000 1.499
+++ bfd/elf.c 2 Feb 2010 22:46:48 -0000
@@ -4462,6 +4462,22 @@ assign_file_positions_for_load_sections
}
p->p_memsz += adjust;
+ if (p->p_paddr + p->p_memsz != sec->lma)
+ {
+ /* This behavior is a compromise--ld has long
+ silently changed the lma of sections when
+ lma - vma is not equal for every section in a
+ pheader--but only in the internal elf structures.
+ Silently changing the lma is probably a bug, but
+ changing it would have subtle and unknown
+ consequences for existing scripts.
+
+ Instead modify the bfd data structure to reflect
+ what happened. This at least fixes the values
+ for the lma in the mapfile. */
+ sec->lma = p->p_paddr + p->p_memsz;
+ }
+
if (this_hdr->sh_type != SHT_NOBITS)
{
if (p->p_filesz + adjust < p->p_memsz)
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11219
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.