This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Scan for Mach-O start address in LC_MAIN and properly check bfd_mach_o_scan_start_address's return value
- From: Tristan Gingold <gingold at adacore dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: "binutils at sourceware dot org Development" <binutils at sourceware dot org>
- Date: Mon, 4 Feb 2013 15:49:12 +0100
- Subject: Re: [PATCH] Scan for Mach-O start address in LC_MAIN and properly check bfd_mach_o_scan_start_address's return value
- References: <CAKYxTUYkjYQyPzOvTXQNJEyH10YJxy=H1YppPCDuVz=AT1Ln3g@mail.gmail.com> <A9B199BF-C931-4707-8DFF-080A75A41520@adacore.com> <20130204122223.GD5023@bubble.grove.modra.org>
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++)