Message ID | CAEG7qUyQPNG1EtSwWSC77vUm+PZXUpDBtm5obab+Y5aa9Vv4-A@mail.gmail.com |
---|---|
State | Superseded |
Headers |
Received: (qmail 28214 invoked by alias); 21 Nov 2014 18:44:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 28123 invoked by uid 89); 21 Nov 2014 18:44:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-oi0-f47.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=mDIG9CPlLf63i9IN9sG6/kiFkSgkSD+g2lajzY8EMME=; b=Ovns9p9mRk7ChGF25GCvwOWZ2+7itQ6zfkPZAVt1VO9l8VkdMlFZhkFXEPA8Wduqz7 dvnzuoHchAtGej5Hy19Vkh5oh4C9K7PR4H4R6hiZIP+hV1OiQkX4LKNxQDdHfcYHTBWG Jem5pbk4OQOiriHfRou3nD9xA9Q5Tqjo+8+MsdQi2eWX3XywRdpGd9gZqgoHd903T96X S7JALwwoHd4JUSs9hevQBsFUnmw9NeTxCQ7RieSdnWQXJaxrytmw33X58E+440HgCnOF WOLh53z0bB4fYHwEH/FPc8b+Rf1W743CZvx6Z2VCxqI+voZHrqPyqK0rqgpX8/8bHOtr FtMQ== X-Gm-Message-State: ALoCoQmWNvxQpPGRn0HH3u5m87T8cw61HFFYiEz9xI6Rp050TgPdc87p4vnBxDkJlOvp1VaXvLrI MIME-Version: 1.0 X-Received: by 10.202.205.200 with SMTP id d191mr3852848oig.37.1416595472176; Fri, 21 Nov 2014 10:44:32 -0800 (PST) Date: Fri, 21 Nov 2014 10:44:32 -0800 Message-ID: <CAEG7qUyQPNG1EtSwWSC77vUm+PZXUpDBtm5obab+Y5aa9Vv4-A@mail.gmail.com> Subject: [Patch] Add .size directives to x86_64 start.S, and possibly more From: Sterling Augustine <saugustine@google.com> To: libc-alpha@sourceware.org, carlos@redhat.org Content-Type: text/plain; charset=UTF-8 |
Commit Message
Sterling Augustine
Nov. 21, 2014, 6:44 p.m. UTC
Hello, 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 issues? Sterling ChangeLog 2014-11-21 Sterling Augustine <saugustine@google.com> * sysdeps/x86_64/start.S: Add .size directive.
Comments
On Fri, Nov 21, 2014 at 10:44 AM, Sterling Augustine <saugustine@google.com> wrote: > Hello, > > 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 > issues? > > Sterling > > ChangeLog > > 2014-11-21 Sterling Augustine <saugustine@google.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. */ > cfi_endproc > + .size _start, .-_start > > /* Define a symbol for the first piece of initialized data. */ > .data Why not use ENTRY/END macros?
On Fri, Nov 21, 2014 at 10:52 AM, H.J. Lu <hjl.tools@gmail.com> wrote: > On Fri, Nov 21, 2014 at 10:44 AM, Sterling Augustine > <saugustine@google.com> wrote: >> Hello, >> >> 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 >> issues? >> >> Sterling >> >> ChangeLog >> >> 2014-11-21 Sterling Augustine <saugustine@google.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. */ >> cfi_endproc >> + .size _start, .-_start >> >> /* Define a symbol for the first piece of initialized data. */ >> .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.
On Fri, Nov 21, 2014 at 11:02 AM, Sterling Augustine <saugustine@google.com> wrote: > On Fri, Nov 21, 2014 at 10:52 AM, H.J. Lu <hjl.tools@gmail.com> wrote: >> On Fri, Nov 21, 2014 at 10:44 AM, Sterling Augustine >> <saugustine@google.com> wrote: >>> Hello, >>> >>> 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 >>> issues? >>> >>> Sterling >>> >>> ChangeLog >>> >>> 2014-11-21 Sterling Augustine <saugustine@google.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. */ >>> cfi_endproc >>> + .size _start, .-_start >>> >>> /* Define a symbol for the first piece of initialized data. */ >>> .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. We can add # define ENTRY_NO_MCOUNT ... #define ENRTY ... ENTRY_NO_MCOUNT CALL_MCOUNT Then we can use ENTRY_NO_MCOUNT if needed. H.J.
Sterling Augustine <saugustine@google.com> writes: > I'm hazy here, but I don't think things are sufficiently initialized > by _start to call mcount, which ENTRY does. start doesn't have a .po variant, so it doesn't matter. Andreas.
On Fri, Nov 21, 2014 at 11:57 AM, Andreas Schwab <schwab@linux-m68k.org> wrote: > Sterling Augustine <saugustine@google.com> writes: > >> I'm hazy here, but I don't think things are sufficiently initialized >> by _start to call mcount, which ENTRY does. > > start doesn't have a .po variant, so it doesn't matter. So should I follow HJ's approach, or just use an plain ENTRY macro?
On Mon, Nov 24, 2014 at 10:43 AM, Sterling Augustine <saugustine@google.com> wrote: > On Fri, Nov 21, 2014 at 11:57 AM, Andreas Schwab <schwab@linux-m68k.org> wrote: >> Sterling Augustine <saugustine@google.com> writes: >> >>> I'm hazy here, but I don't think things are sufficiently initialized >>> by _start to call mcount, which ENTRY does. >> >> start doesn't have a .po variant, so it doesn't matter. > > So should I follow HJ's approach, or just use an plain ENTRY macro? Plain ENTRY is preferred if it works. Thanks.
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. */ cfi_endproc + .size _start, .-_start /* Define a symbol for the first piece of initialized data. */ .data