This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: ld/2338: objdump -d -l doesn't work correctly
On Tue, Feb 21, 2006 at 05:54:42PM -0800, H. J. Lu wrote:
> PR binutils/2338
> * dwarf2.c (loadable_section): New struct.
> (dwarf2_debug): Add loadable_section_count and
> loadable_sections.
> (check_function_name): Removed.
> (unset_sections): New.
> (place_sections): New.
> (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections
> and unset_sections on relocatable files.
> (_bfd_dwarf2_find_line): Likewise.
OK, except..
> + vma = sect->vma;
> + p->section = sect;
> + p->orig_vma = vma;
> + if (current_vma != 0)
> + sect->vma = current_vma;
> + p->adj_vma = sect->vma;
> + current_vma += vma + sz + 1;
..don't add one here. This will likely break targets that expect insns
on a multiple of 2 or 4 boudary. Instead, you ought to heed alignment
when setting the vma, and also round size up according to the alignment.
p->section = sect;
p->orig_vma = sect->vma;
sect->vma = ((current_vma + ~((bfd_vma) -1 << sect->alignment_power))
& ((bfd_vma) -1 << sect->alignment_power));
p->adj_vma = sect->vma;
sz = ((sz + ~((bfd_vma) -1 << sect->alignment_power))
& ((bfd_vma) -1 << sect->alignment_power));
current_vma = sect->vma + sz;
--
Alan Modra
IBM OzLabs - Linux Technology Centre