PATCH: Adjust segment memory size for the SHT_NOBITS section
Alan Modra
amodra@bigpond.net.au
Fri Mar 2 03:02:00 GMT 2007
More information about the Binutils mailing list
Fri Mar 2 03:02:00 GMT 2007
- Previous message (by thread): PATCH: Adjust segment memory size for the SHT_NOBITS section
- Next message (by thread): PATCH: Adjust segment memory size for the SHT_NOBITS section
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Mar 01, 2007 at 05:08:48PM -0800, H. J. Lu wrote: > --- bfd/elf.c.nobits 2007-03-01 15:25:22.000000000 -0800 > +++ bfd/elf.c 2007-03-01 17:00:52.000000000 -0800 > @@ -4623,11 +4623,15 @@ assign_file_positions_for_load_sections > /* The section VMA must equal the file position > modulo the page size. */ > bfd_size_type page = align; > + bfd_signed_vma diff = sec->vma - p->p_vaddr - p->p_memsz; > if (page < maxpagesize) > page = maxpagesize; > adjust = vma_page_aligned_bias (sec->vma, > p->p_vaddr + p->p_memsz, > page); > + /* Adjust for the section VMA > the page size. */ > + if (diff > 0) > + adjust += page * (diff / page); > p->p_memsz += adjust; > } > } Look at the definition of vma_page_aligned_bias. I'm sure you'll see that you can simplify this code, and will end up with something like the code for the ajustment based on lma just above, but using vma. Then of course you'd have to wonder why the code wasn't written that way in the first place. Please do some digging to find out why. -- Alan Modra IBM OzLabs - Linux Technology Centre
- Previous message (by thread): PATCH: Adjust segment memory size for the SHT_NOBITS section
- Next message (by thread): PATCH: Adjust segment memory size for the SHT_NOBITS section
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list