This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: segfault in bfd with large static binary


On Fri, Feb 03, 2006 at 12:37:01PM +0000, Nick Clifton wrote:
> Hi H. J.,  Hi Mike,
> 
> >>with that patch by Nick, `strip` didnt segfault ...
> 
> >It just papers over the real problem.
> 
> This is correct.  There is nothing wrong with my patch per-se, checking 
> for a NULL pointer is never a bad idea, it is just that it does not get 

If we need to check, it should be

	BFD_ASSERT (link_info != NULL);

since link_info is required to set up GNU_RELRO segmwent.

> to the heart of the matter.
> 

The problem is

[hjl@gnu-13 strip-3]$ readelf -l busybox
...
Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
...
  GNU_RELRO      0x00000000001e0f18 0x00000000006e0f18  0x00000000006e0ee8
                 0x0000000000000038 0x0000000000000038  R      8

PhysAddr of GNU_RELRO segmwent in busybox is different from its
VirtAddr. There is nothing wrong per gABI since System V doesn't
specify it. But copy_private_bfd_data can't handle it properly.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]