This is the mail archive of the
mailing list for the glibc project.
Re: [Patch] Add .size directives to x86_64 start.S, and possibly more
- From: Sterling Augustine <saugustine at google dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, carlos at redhat dot org
- Date: Fri, 21 Nov 2014 11:02:48 -0800
- Subject: Re: [Patch] Add .size directives to x86_64 start.S, and possibly more
- Authentication-results: sourceware.org; auth=none
- References: <CAEG7qUyQPNG1EtSwWSC77vUm+PZXUpDBtm5obab+Y5aa9Vv4-A at mail dot gmail dot com> <CAMe9rOq+bKtiJaAfa5sxx-PjiHLutdYBT1p=7K24KPcoB0pbug at mail dot gmail dot com>
On Fri, Nov 21, 2014 at 10:52 AM, H.J. Lu <email@example.com> wrote:
> On Fri, Nov 21, 2014 at 10:44 AM, Sterling Augustine
> <firstname.lastname@example.org> wrote:
>> sysdeps/x86_64/start.S doesn't have a .size elf directive for _start.
>> This tripped up some analysis I was doing.
>> This patch is the straightforward fix. Would you be interested in a
>> similar fix for the ~150 assembly files inside x86_64 with similar
>> 2014-11-21 Sterling Augustine <email@example.com>
>> * sysdeps/x86_64/start.S: Add .size directive.
>> diff --git a/sysdeps/x86_64/start.S b/sysdeps/x86_64/start.S
>> index e3d4ff8..5106bd0 100644
>> --- a/sysdeps/x86_64/start.S
>> +++ b/sysdeps/x86_64/start.S
>> @@ -124,6 +124,7 @@ _start:
>> hlt /* Crash if somehow `exit' does return. */
>> + .size _start, .-_start
>> /* Define a symbol for the first piece of initialized data. */
> Why not use ENTRY/END macros?
I'm hazy here, but I don't think things are sufficiently initialized
by _start to call mcount, which ENTRY does. You are right though, in
that most of the other files do use END, and so the cleanup isn't as
big as I thought.
It probably doesn't make sense to use an END without a corresponding
ENTRY in start.S, but I'm fine with whatever.