segfault in bfd with large static binary

H. J. Lu hjl@lucon.org
Fri Feb 3 15:54:00 GMT 2006


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.



More information about the Binutils mailing list