glibc/gmon
H.J. Lu 84a7eb1f87 Use __executable_start as the lowest address for profiling [BZ #28153]
Glibc assumes that ENTRY_POINT is the lowest address for which we need
to keep profiling records and BFD linker uses a linker script to place
the input sections.

Starting from GCC 4.6, the main function is placed in .text.startup
section and starting from binutils 2.22, BFD linker with

commit add44f8d5c5c05e08b11e033127a744d61c26aee
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Nov 25 03:03:02 2010 +0000

            * scripttempl/elf.sc: Group .text.exit, text.startup and .text.hot
            sections.

places .text.startup section before .text section, which leave the main
function out of profiling records.

Starting from binutils 2.15, linker provides __executable_start to mark
the lowest address of the executable.  Use __executable_start as the
lowest address to keep the main function in profiling records. This fixes
[BZ #28153].

Tested on Linux/x86-64, Linux/x32 and Linux/i686 as well as with
build-many-glibcs.py.
2021-08-24 06:44:18 -07:00
..
sys Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
gmon.c Support profiling PIE [BZ #22284] 2017-10-12 03:49:40 -07:00
Makefile Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
mcount.c Don't use catomic functions in mcount (BZ #16912) 2014-05-06 16:30:48 +02:00
prof-freq.c
profil.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
sprofil.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-gmon-gprof.sh Use __executable_start as the lowest address for profiling [BZ #28153] 2021-08-24 06:44:18 -07:00
tst-gmon-pie.c Support profiling PIE [BZ #22284] 2017-10-12 03:49:40 -07:00
tst-gmon-static-gprof.sh Use __executable_start as the lowest address for profiling [BZ #28153] 2021-08-24 06:44:18 -07:00
tst-gmon-static-pie.c Add --enable-static-pie configure option to build static PIE [BZ #19574] 2017-12-15 17:12:14 -08:00
tst-gmon-static.c Add a test for profiling static executable 2017-10-14 12:58:55 -07:00
tst-gmon.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-profile-static.c
tst-sprofil.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Versions linux: Make profil_counter a compat_symbol (BZ#17726) 2019-08-23 11:30:56 -03:00