executable-format

What sections are required for a usable ELF executable?

限于喜欢 提交于 2019-12-12 17:15:13
问题 I'm creating an ELF executable file and I need to know what sections are required by the operating system in order to load and execute it. Details: OS: Ubuntu 10.04 (64-bit) Kernel version: 2.6.32-24 Architecture: i386 I realize that the following would probably be necessary: .text .symtab .rel.text Are there others? 回答1: "A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux " has information on how to (ab)use the various ELF sections to make an executable as small as

How is a process created from an ELF file?

北战南征 提交于 2019-12-12 04:24:21
问题 Can anyone please share some link or book that explains in detail about how a process is created from an ELF file. Most of the materials freely available seems to be abstract with out explaining most details like what information is taken from program headers and how the process image is in memory using that information. Thanks 回答1: elf files work in the following way Every segment describes a bunch of sections sharing the same charcteristics together, such as Load to memory, each section has

Is a core dump executable by itself?

拥有回忆 提交于 2019-12-04 22:10:36
问题 The Wikipedia page on Core dump says In Unix-like systems, core dumps generally use the standard executable image-format: a.out in older versions of Unix, ELF in modern Linux, System V, Solaris, and BSD systems, Mach-O in OS X, etc. Does this mean a core dump is executable by itself? If not, why not? Edit: Since @WumpusQ.Wumbley mentions a coredump_filter in a comment, perhaps the above question should be: can a core dump be produced such that it is executable by itself? 回答1: In older unix

Exec format error 32-bit executable Windows Subsystem for Linux?

大兔子大兔子 提交于 2019-11-30 05:53:46
问题 When I try to execute a 32-bit file compiled with gcc -m32 main.c -o main on Windows Subsystem for Linux , I get the following error: bash: ./main: cannot execute binary file: Exec format error . If I compile it without -m32 it runs. Any solution for running 32-bit executable on WSL ? 回答1: 32-bit ELF support isn't provided by WSL (yet). There doesn't seem to be any progress since the UserVoice was raised - you are out luck. See UserVoice: Please add 32 bit ELF support to the kernel and

Why are compiled Java class files smaller than C compiled files?

时光总嘲笑我的痴心妄想 提交于 2019-11-29 03:46:01
I would like to know why the .o file that we get from compiling a .c file that prints "Hello, World!" is larger than a Java .class file that also prints "Hello, World!"? Java uses Bytecode to be platform independent and "precompiled", but bytecode is used by interpreter and is served to be compact enough, so it is not the same that machine code which you can see in compiled C program. Just take a look at the full process of Java compilation: Java program -> Bytecode -> High-level Intermediate Representation (HIR) -> Middle-level Intermediate Representation (MIR) -> Low-level Intermediate

Why are compiled Java class files smaller than C compiled files?

拥有回忆 提交于 2019-11-27 22:16:05
问题 I would like to know why the .o file that we get from compiling a .c file that prints "Hello, World!" is larger than a Java .class file that also prints "Hello, World!"? 回答1: Java uses Bytecode to be platform independent and "precompiled", but bytecode is used by interpreter and is served to be compact enough, so it is not the same that machine code which you can see in compiled C program. Just take a look at the full process of Java compilation: Java program -> Bytecode -> High-level