bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/23574] New: strip removes all symbols, including _start, c


From: shawnlandden at gmail dot com
Subject: [Bug binutils/23574] New: strip removes all symbols, including _start, causing binary to segfault
Date: Sun, 26 Aug 2018 14:58:19 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=23574

            Bug ID: 23574
           Summary: strip removes all symbols, including _start, causing
                    binary to segfault
           Product: binutils
           Version: 2.31
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: shawnlandden at gmail dot com
  Target Milestone: ---

https://github.com/ziglang/zig/issues/1423

address@hidden:~/git/zig$ cat ~/bin/hello2.zig 
pub fn main() void {

}
address@hidden:~/git/zig$ ./zig build-exe ~/bin/hello2.zig --release-fast
address@hidden:~/git/zig$ ./hello2
address@hidden:~/git/zig$ strip hello2
address@hidden:~/git/zig$ ./hello2
Segmentation fault

address@hidden:~/git/zig$ ./zig build-exe ~/bin/hello2.zig --release-fast
address@hidden:~/git/zig$ objdump --all hello2

hello2:     file format elf64-x86-64
hello2
architecture: i386:x86-64, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000000201000

Program Header:
    PHDR off    0x0000000000000040 vaddr 0x0000000000200040 paddr
0x0000000000200040 align 2**3
         filesz 0x0000000000000118 memsz 0x0000000000000118 flags r--
    LOAD off    0x0000000000000000 vaddr 0x0000000000200000 paddr
0x0000000000200000 align 2**12
         filesz 0x0000000000000158 memsz 0x0000000000000158 flags r--
    LOAD off    0x0000000000001000 vaddr 0x0000000000201000 paddr
0x0000000000201000 align 2**12
         filesz 0x000000000000007f memsz 0x000000000000007f flags r-x
    LOAD off    0x0000000000002000 vaddr 0x0000000000202000 paddr
0x0000000000202000 align 2**12
         filesz 0x0000000000000028 memsz 0x0000000000000028 flags rw-
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr
0x0000000000000000 align 2**0
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         0000007f  0000000000201000  0000000000201000  00001000  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000028  0000000000202000  0000000000202000  00002000  2**3
                  CONTENTS, ALLOC, LOAD, DATA
  2 .debug_str    000015ed  0000000000000000  0000000000000000  00002028  2**0
                  CONTENTS, READONLY, DEBUGGING
  3 .debug_loc    000072eb  0000000000000000  0000000000000000  00003615  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_abbrev 000005a8  0000000000000000  0000000000000000  0000a900  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_info   00005085  0000000000000000  0000000000000000  0000aea8  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_ranges 00001ee0  0000000000000000  0000000000000000  0000ff2d  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_macinfo 00000003  0000000000000000  0000000000000000  00011e0d  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_pubnames 00000cb3  0000000000000000  0000000000000000  00011e10 
2**0
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_pubtypes 0000039a  0000000000000000  0000000000000000  00012ac3 
2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_frame  000005e0  0000000000000000  0000000000000000  00012e60  2**3
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_line   00002307  0000000000000000  0000000000000000  00013440  2**0
                  CONTENTS, READONLY, DEBUGGING
 12 .comment      00000012  0000000000000000  0000000000000000  00015747  2**0
                  CONTENTS, READONLY
SYMBOL TABLE:
0000000000202010 l     O .data  0000000000000008 argc_ptr
0000000000201010 l     F .text  000000000000006f posixCallMainAndExit
0000000000202000 l     O .data  0000000000000010 posix_environ_raw
0000000000202018 l     O .data  0000000000000010 raw
0000000000201000 g     F .text  0000000000000010 _start


address@hidden:~/git/zig$ strip hello2
address@hidden:~/git/zig$ objdump --all hello2

hello2:     file format elf64-x86-64
hello2
architecture: i386:x86-64, flags 0x00000102:
EXEC_P, D_PAGED
start address 0x0000000000201000

Program Header:
    PHDR off    0x0000000000000040 vaddr 0x0000000000000040 paddr
0x0000000000200040 align 2**3
         filesz 0x0000000000000118 memsz 0x0000000000000118 flags r--
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr
0x0000000000200000 align 2**12
         filesz 0x0000000000000158 memsz 0x0000000000000158 flags r--
    LOAD off    0x0000000000001000 vaddr 0x0000000000201000 paddr
0x0000000000201000 align 2**12
         filesz 0x000000000000007f memsz 0x000000000000007f flags r-x
    LOAD off    0x0000000000002000 vaddr 0x0000000000202000 paddr
0x0000000000202000 align 2**12
         filesz 0x0000000000000028 memsz 0x0000000000000028 flags rw-
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr
0x0000000000000000 align 2**0
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         0000007f  0000000000201000  0000000000201000  00001000  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000028  0000000000202000  0000000000202000  00002000  2**3
                  CONTENTS, ALLOC, LOAD, DATA
  2 .comment      00000012  0000000000000000  0000000000000000  00002028  2**0
                  CONTENTS, READONLY
SYMBOL TABLE:
no symbols

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]