This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: question about "Failed to execute /init"
- From: Sandeep K Sinha <sandeepksinha at gmail dot com>
- To: loody <miloody at gmail dot com>
- Cc: linux-arm-kernel at lists dot arm dot linux dot org dot uk, kernelnewbies at nl dot linux dot org, binutils at sourceware dot org
- Date: Mon, 26 Jan 2009 10:48:19 +0530
- Subject: Re: question about "Failed to execute /init"
- References: <3a665c760901231131y441164adu8474f52773762484@mail.gmail.com> <447408.2516.qm@web15702.mail.cnb.yahoo.com> <3a665c760901240752jaaa25adge97b3b5b4570b021@mail.gmail.com> <3a665c760901250832s532cc582k5d5ff72b6b13221f@mail.gmail.com>
You should have asked this at the bunutils list.
cc'inf binutils.
On Sun, Jan 25, 2009 at 10:02 PM, loody <miloody@gmail.com> wrote:
>> my init is a very simple program like below
>>
>> #include <stdio.h>
>> int main()
>> {
>> printf("hello world\n");
>> sleep(999999);
>> return 0;
>> }
>> And my init is static build with "-static" option and I use
>> cross-objdump to read it and it doesn't tell me there are any library
>> it depends on.
> Dear all:
> I find there is some problem about kernel setting to support loading
> static/dynamic elf format.
> I study the kernel source and find my error comes from
> search_binary_handler and it return -8, -ENOEXEC, while executing,
> fmt->load_binary.
>
> In kernel source, the core_initcall will register different
> init_elf_xxxfmt, and it seems this option will determine whether
> kernel support dynamic or static elf execute files.
> And kernel seems support these binfmts:
> binfmt_aout.c:static struct linux_binfmt aout_format = {
> binfmt_elf.c:static struct linux_binfmt elf_format = {
> binfmt_elf_fdpic.c:static struct linux_binfmt elf_fdpic_format = {
> binfmt_em86.c:static struct linux_binfmt em86_format = {
> binfmt_flat.c:static struct linux_binfmt flat_format = {
> binfmt_misc.c:static struct linux_binfmt misc_format = {
> binfmt_script.c:static struct linux_binfmt script_format = {
> binfmt_som.c:static struct linux_binfmt som_format = {
>
> And I check my fs folder and I only see this *.o files:
> -rw-r--r-- 1 root root 2748 2009-01-23 11:42 binfmt_script.o
> which is the default binfmt that will support.
>
> My questions are:
> 1. are my assumptions above correct? take my static build init for
> example, should I check whether static binary elf support code has
> build in my kernel?
> 2. if my assumption correct, which one in the list is my choice and
> what config I should add in my uclinxu kernel config?
> 3. if my assumption above is wrong and kernel will default support
> static elf file, why I get -8, -ENOEXEC, while calling
> fmt->load_binary.
> 4. There is only binfmt_script.o build in my kernel, but why in try=2
> loop in search_binary_handler, I still get 2 fmt->load_binarys. There
> should only be 1 fmt->load_binary, load_script in Binfmt_script.c.
>
> appreciate your help,
> miloody
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>
--
Regards,
Sandeep.
"To learn is to change. Education is a process that changes the learner."