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: PATCH: PR binutils/4756: addr2line fails on relocatable linux kernel


On Tue, Jul 10, 2007 at 11:21:08PM +0930, Alan Modra wrote:
> On Mon, Jul 09, 2007 at 11:43:40AM -0700, H.J. Lu wrote:
> > the same check in binutils/objdump.c.
> 
> Hmm, which needs correcting like objcopy PR 4716 fix.
> 
> 	* objdump.c (dump_dwarf): Correct setting of is_relocatable.
> 
> Index: binutils/objdump.c
> ===================================================================
> RCS file: /cvs/src/src/binutils/objdump.c,v
> retrieving revision 1.131
> diff -u -p -r1.131 objdump.c
> --- binutils/objdump.c	5 Jul 2007 16:54:45 -0000	1.131
> +++ binutils/objdump.c	10 Jul 2007 13:46:28 -0000
> @@ -2166,8 +2166,7 @@ check_mach_o_dwarf (bfd *abfd)
>  static void
>  dump_dwarf (bfd *abfd)
>  {
> -  is_relocatable = ((abfd->flags & (HAS_RELOC | EXEC_P | DYNAMIC))
> -		    == HAS_RELOC);
> +  is_relocatable = (abfd->flags & (EXEC_P | DYNAMIC)) == 0;
>  
>    /* FIXME: bfd_get_arch_size may return -1.  We assume that 64bit
>       targets will return 64.  */
> 

For bfd_simple_get_relocated_section_content,

if ((abfd->flags & (HAS_RELOC | EXEC_P | DYNAMIC)) != HAS_RELOC
    || ! (sec->flags & SEC_RELOC))

is the same as

if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0
    || ! (sec->flags & SEC_RELOC))

But we don't need to check (sec->flags & SEC_RELOC) if
(abfd->flags & HAS_RELOC) == 0.


H.J.


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