Bug 23898

Summary: readelf: Warning: Gap in build notes detected from 0x401127 to 0x40113f
Product: binutils Reporter: H.J. Lu <hjl.tools>
Component: binutilsAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.32   
Target Milestone: 2.32   
Host: Target:
Build: Last reconfirmed:

Description H.J. Lu 2018-11-19 19:54:03 UTC
On Fedora 29, I got

[hjl@gnu-cfl-1 tmp]$ cat /export/gnu/import/git/sources/binutils-gdb/ld/testsuite/ld-x86-64/pass.c
#include <stdio.h>

int
main ()
{
  printf ("PASS\n");
  return 0;
}
[hjl@gnu-cfl-1 tmp]$ gcc -g -O0 -Wa,-mx86-used-note=no -c /export/gnu/import/git/sources/binutils-gdb/ld/testsuite/ld-x86-64/pass.c
[hjl@gnu-cfl-1 tmp]$ gcc -g -O0 -Wa,-mx86-used-note=no  /export/gnu/import/git/sources/binutils-gdb/ld/testsuite/ld-x86-64/pass.c
[hjl@gnu-cfl-1 tmp]$ readelf -n a.out > /dev/null
readelf: Warning: Gap in build notes detected from 0x401127 to 0x40113f
[hjl@gnu-cfl-1 tmp]$ gcc -g -O2 -Wa,-mx86-used-note=no  /export/gnu/import/git/sources/binutils-gdb/ld/testsuite/ld-x86-64/pass.c
[hjl@gnu-cfl-1 tmp]$ readelf -n a.out > /dev/null
[hjl@gnu-cfl-1 tmp]$ 

-O0 triggers "Warning: Gap in build notes detected from 0x401127 to 0x40113".
Comment 1 H.J. Lu 2018-11-19 20:26:14 UTC
    Applies to region from 0x401080 to 0x401126
  GA$<version>3p8      0x00000010       OPEN
readelf: Warning: Gap in build notes detected from 0x401127 to 0x40113f
    Applies to region from 0x401140 to 0x4011b5 (.annobin_elf_init.c)
  GA$<tool>gcc 8.2.1 2 0x00000000       OPEN

0000000000401000 T _init
0000000000401040 T _start
000000000040106f t .annobin_init.c
000000000040106f t .annobin_init.c_end
0000000000401070 t .annobin_static_reloc.c
0000000000401070 T _dl_relocate_static_pie
0000000000401075 t .annobin_static_reloc.c_end
0000000000401080 t deregister_tm_clones
00000000004010b0 t register_tm_clones
00000000004010f0 t __do_global_dtors_aux
0000000000401120 t frame_dummy
0000000000401126 T main
0000000000401140 t .annobin_elf_init.c
0000000000401140 T __libc_csu_init
00000000004011b0 T __libc_csu_fini
00000000004011b5 t .annobin_elf_init.c_end
00000000004011b8 T _fini
Comment 2 Sourceware Commits 2018-11-20 14:46:51 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f92f9e8780f74c5084c59689f91d28b8a3471538

commit f92f9e8780f74c5084c59689f91d28b8a3471538
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Nov 20 06:45:28 2018 -0800

    readelf: Prune gaps warning in build notes
    
    Since some object files may not have build notes, it is normal to have
    gaps in build notes.
    
    	PR binutils/23898
    	* testsuite/lib/binutils-common.exp (prune_warnings_extra):
    	Prune gaps in build notes.
Comment 3 H.J. Lu 2018-11-20 17:03:18 UTC
Fixed.