When we are outputing an empty loadable section, we consider it not loadable. But we still align it at page boundary:
[EMAIL PROTECTED] empty-10]$ !cat cat foo.c extern char *__init_array_start; int xxx = 10; _start () { return __init_array_start != 0; } [EMAIL PROTECTED] empty-10]$ make LD=ld gcc -c -o foo.o foo.c ld -o foo foo.o readelf -Sl foo There are 9 section headers, starting at offset 0x2001b0: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .text PROGBITS 00000000004000e8 000000e8 0000000000000016 0000000000000000 AX 0 0 4 [ 2] .eh_frame PROGBITS 0000000000400100 00000100 0000000000000038 0000000000000000 A 0 0 8 [ 3] .init_array INIT_ARRAY 0000000000600138 00200138 0000000000000000 0000000000000000 WA 0 0 1 [ 4] .data PROGBITS 0000000000600138 00000138 0000000000000004 0000000000000000 WA 0 0 4 [ 5] .comment PROGBITS 0000000000000000 00200138 000000000000002d 0000000000000000 0 0 1 [ 6] .shstrtab STRTAB 0000000000000000 00200165 0000000000000046 0000000000000000 0 0 1 [ 7] .symtab SYMTAB 0000000000000000 002003f0 0000000000000138 0000000000000018 8 8 8 [ 8] .strtab STRTAB 0000000000000000 00200528 000000000000003d 0000000000000000 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings) I (info), L (link order), G (group), x (unknown) O (extra OS processing required) o (OS specific), p (processor specific) Elf file type is EXEC (Executable file) Entry point 0x4000e8 There are 3 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align LOAD 0x0000000000000000 0x0000000000400000 0x0000000000400000 0x0000000000000138 0x0000000000000138 R E 200000 LOAD 0x0000000000000138 0x0000000000600138 0x0000000000600138 0x0000000000000004 0x0000000000000004 RW 200000 GNU_STACK 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 RW 8 Section to Segment mapping: Segment Sections... 00 .text .eh_frame 01 .data 02 [EMAIL PROTECTED] empty-10]$ -- Summary: ELF linker aligns empty section Product: binutils Version: 2.18 (HEAD) Status: NEW Severity: normal Priority: P2 Component: ld AssignedTo: unassigned at sources dot redhat dot com ReportedBy: hjl at lucon dot org CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=3314 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils