diff options
author | Sterling Augustine <saugustine@google.com> | 2010-02-05 17:08:47 +0000 |
---|---|---|
committer | Sterling Augustine <saugustine@google.com> | 2010-02-05 17:08:47 +0000 |
commit | 1cfb7d1ee10218f97feca406029b03c7692e1157 (patch) | |
tree | f23009259f8711f29be08a1d1ceaa08821242176 /bfd/elf.c | |
parent | 2ad0ff16f7cee57d331450162ec1c2214af9792a (diff) | |
download | gdb-1cfb7d1ee10218f97feca406029b03c7692e1157.zip gdb-1cfb7d1ee10218f97feca406029b03c7692e1157.tar.gz gdb-1cfb7d1ee10218f97feca406029b03c7692e1157.tar.bz2 |
2010-02-05 Sterling Augustine <sterling@tensilica.com>
* elf.c (assign_file_positions_for_load_sections) Update lma of
section if necessary.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -4462,6 +4462,22 @@ assign_file_positions_for_load_sections (bfd *abfd, } 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) |