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] Scan for Mach-O start address in LC_MAIN and properly check bfd_mach_o_scan_start_address's return value


On Feb 4, 2013, at 1:22 PM, Alan Modra wrote:

> On Thu, Jan 31, 2013 at 10:55:23AM +0100, Tristan Gingold wrote:
>> 	* mach-o.c (bfd_mach_o_scan): Call bfd_mach_o_flatten_sections
>> 	earlier.  Fix status checking of bfd_mach_o_scan_start_address.
>> 	(bfd_mach_o_scan_start_address): Handle LC_MAIN.
> 
> Results in 388 regressions for --target=i386-darwin.
> +FAIL: ar symbol table
> +FAIL: ar thin archive
> +FAIL: ar thin archive with nested archive
> +FAIL: nm (no arguments)
> +FAIL: nm -g
> +FAIL: nm -P
> +FAIL: objcopy --reverse-bytes
> +FAIL: objcopy -O srec
> +ERROR: objdump can not recognize bintest.o
> +ERROR: objdump can not recognize bintest.o
> [snip rest]

Fixed by this patch.

Sorry for the breakage.

Tristan.

bfd/
2013-02-04  Tristan Gingold  <gingold@adacore.com>

	* mach-o.c (bfd_mach_o_scan_start_address): Do not fail if no
	start address.

Index: bfd/mach-o.c
===================================================================
RCS file: /cvs/src/src/bfd/mach-o.c,v
retrieving revision 1.110
diff -c -r1.110 mach-o.c
*** bfd/mach-o.c	31 Jan 2013 09:55:41 -0000	1.110
--- bfd/mach-o.c	4 Feb 2013 14:48:14 -0000
***************
*** 3992,3999 ****
  	  }
        }
  
    if (cmd == NULL)
!     return FALSE;
  
    /* FIXME: create a subtarget hook ?  */
    for (i = 0; i < cmd->nflavours; i++)
--- 3992,4000 ----
  	  }
        }
  
+   /* An object file has no start address, so do not fail if not found.  */
    if (cmd == NULL)
!     return TRUE;
  
    /* FIXME: create a subtarget hook ?  */
    for (i = 0; i < cmd->nflavours; i++)


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