[Bug libc/21570] New: Unused INTERP segment in libc.so

hjl.tools at gmail dot com sourceware-bugzilla@sourceware.org
Mon Jun 12 18:25:00 GMT 2017


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

            Bug ID: 21570
           Summary: Unused INTERP segment in libc.so
           Product: glibc
           Version: 2.26
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

[hjl@gnu-6 build-x86_64-linux]$ readelf -l libc.so

Elf file type is DYN (Shared object file)
Entry point 0x20be0
There are 10 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x0000000000000040 0x0000000000000040
                 0x0000000000000230 0x0000000000000230  R E    0x8
  INTERP         0x000000000016db20 0x000000000016db20 0x000000000016db20
                 0x000000000000001c 0x000000000000001c  R      0x10
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
^^^^^^^^^^^^^^ Why is it needed?

  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x00000000001964c8 0x00000000001964c8  R E    0x200000
  LOAD           0x00000000001967c8 0x00000000003967c8 0x00000000003967c8
                 0x0000000000004fd8 0x0000000000009238  RW     0x200000
  DYNAMIC        0x0000000000199ba0 0x0000000000399ba0 0x0000000000399ba0
                 0x00000000000001e0 0x00000000000001e0  RW     0x8
  NOTE           0x0000000000000270 0x0000000000000270 0x0000000000000270
                 0x0000000000000044 0x0000000000000044  R      0x4
  TLS            0x00000000001967c8 0x00000000003967c8 0x00000000003967c8
                 0x0000000000000010 0x0000000000000078  R      0x8
  GNU_EH_FRAME   0x000000000016db3c 0x000000000016db3c 0x000000000016db3c
                 0x0000000000005b9c 0x0000000000005b9c  R      0x4
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     0x10
  GNU_RELRO      0x00000000001967c8 0x00000000003967c8 0x00000000003967c8
                 0x0000000000003838 0x0000000000003838  R      0x1

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .interp 
   02     .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr
.gnu.version .gnu.version_d .gnu.version_r .rela.dyn .rela.plt .plt .plt.got
.text __libc_freeres_fn __libc_thread_freeres_fn .rodata .interp .eh_frame_hdr
.eh_frame .gcc_except_table .hash 
   03     .tdata .init_array __libc_subfreeres __libc_atexit
__libc_thread_subfreeres __libc_IO_vtables .data.rel.ro .dynamic .got .got.plt
.data __libc_freeres_ptrs .bss 
   04     .dynamic 
   05     .note.gnu.build-id .note.ABI-tag 
   06     .tdata .tbss 
   07     .eh_frame_hdr 
   08     
   09     .tdata .init_array __libc_subfreeres __libc_atexit
__libc_thread_subfreeres __libc_IO_vtables .data.rel.ro .dynamic .got 
[hjl@gnu-6 build-x86_64-linux]$ 

When I removed it, I got

[hjl@gnu-6 build-x86_64-linux]$ readelf -l /tmp/libc.so 

Elf file type is DYN (Shared object file)
Entry point 0x20b70
There are 8 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000196430 0x0000000000196430  R E    0x200000
  LOAD           0x00000000001967c8 0x00000000003967c8 0x00000000003967c8
                 0x0000000000004fd8 0x0000000000009238  RW     0x200000
  DYNAMIC        0x0000000000199ba0 0x0000000000399ba0 0x0000000000399ba0
                 0x00000000000001e0 0x00000000000001e0  RW     0x8
  NOTE           0x0000000000000200 0x0000000000000200 0x0000000000000200
                 0x0000000000000044 0x0000000000000044  R      0x4
  TLS            0x00000000001967c8 0x00000000003967c8 0x00000000003967c8
                 0x0000000000000010 0x0000000000000078  R      0x8
  GNU_EH_FRAME   0x000000000016daa0 0x000000000016daa0 0x000000000016daa0
                 0x0000000000005b9c 0x0000000000005b9c  R      0x4
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     0x10
  GNU_RELRO      0x00000000001967c8 0x00000000003967c8 0x00000000003967c8
                 0x0000000000003838 0x0000000000003838  R      0x1

 Section to Segment mapping:
  Segment Sections...
   00     .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr
.gnu.version .gnu.version_d .gnu.version_r .rela.dyn .rela.plt .plt .plt.got
.text __libc_freeres_fn __libc_thread_freeres_fn .rodata .eh_frame_hdr
.eh_frame .gcc_except_table .hash 
   01     .tdata .init_array __libc_subfreeres __libc_atexit
__libc_thread_subfreeres __libc_IO_vtables .data.rel.ro .dynamic .got .got.plt
.data __libc_freeres_ptrs .bss 
   02     .dynamic 
   03     .note.gnu.build-id .note.ABI-tag 
   04     .tdata .tbss 
   05     .eh_frame_hdr 
   06     
   07     .tdata .init_array __libc_subfreeres __libc_atexit
__libc_thread_subfreeres __libc_IO_vtables .data.rel.ro .dynamic .got 
[hjl@gnu-6 build-x86_64-linux]$ /tmp/libc.so
GNU C Library (GNU libc) development release version 2.25.90, by Roland McGrath
et al.
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 6.3.1 20170216 (Red Hat 6.3.1-3).
Available extensions:
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
[hjl@gnu-6 build-x86_64-linux]$ 

Do we really need INTERP segment in libc.so?

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


More information about the Glibc-bugs mailing list