Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: John David Anglin <dave@hiauly1.hia.nrc.ca>
Cc: linux-parisc@vger.kernel.org, carlos@systemhalted.org,
	randolph@tausq.org
Subject: Re: Out of order unwind entry warning
Date: Wed, 28 Oct 2009 23:59:47 +0100	[thread overview]
Message-ID: <4AE8CCE3.1030503@gmx.de> (raw)
In-Reply-To: <4AE8C918.8060908@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 2071 bytes --]

On 10/28/2009 11:43 PM, Helge Deller wrote:
> On 10/28/2009 11:18 PM, John David Anglin wrote:
>>>> and whether it follows inb in its .o. From my understanding of things,
>>>> it shouldn't be necessary to remove the unwind info for unused weak
>>>> symbols if they aren't garbage collected. A simple testcase would
>>>> be helpful.

Attached is a testcase (t1.c and t2.c):
t1.c contains weak function f().
t2.c contains non-weak function f().

hppa-linux-gcc -c t1.c t2.c
hppa-linux-ld -r -o all.o t1.o t2.o

hppa-linux-readelf -s t1.o gives:
Symbol table '.symtab' contains 10 entries:
    Num:    Value  Size Type    Bind   Vis      Ndx Name
      6: 00000000    28 FUNC    GLOBAL DEFAULT    1 a
      7: 0000001c    32 FUNC    WEAK   DEFAULT    1 f
      8: 0000003c    28 FUNC    GLOBAL DEFAULT    1 z
      9: 00000058    80 FUNC    GLOBAL DEFAULT    1 main

hppa-linux-readelf -s t2.o  gives:
Symbol table '.symtab' contains 7 entries:
    Num:    Value  Size Type    Bind   Vis      Ndx Name
      6: 00000000    32 FUNC    GLOBAL DEFAULT    1 f

hppa-linux-readelf -s all.o  gives:
Symbol table '.symtab' contains 11 entries:
    Num:    Value  Size Type    Bind   Vis      Ndx Name
      7: 00000000    32 FUNC    GLOBAL DEFAULT    3 f
      8: 0000003c    28 FUNC    GLOBAL DEFAULT    1 z
      9: 00000058    80 FUNC    GLOBAL DEFAULT    1 main
     10: 00000000    28 FUNC    GLOBAL DEFAULT    1 a


hppa-linux-readelf -u all.o  gives:
Unwind section '.PARISC.unwind' at offset 0xfc contains 5 entries:
<a>: [0x0-0x30]
         Entry_GR=1 Save_SP Total_frame_size=8
<f>: [0x0-0x70]
         Entry_GR=1 Save_SP Total_frame_size=8
<z>: [0x3c-0xa8]
         Entry_GR=1 Save_SP Total_frame_size=8
<main>: [0x58-0x148]
         Entry_GR=2 Save_SP Save_RP Total_frame_size=8
<f>: [0x0-0x38]
         Entry_GR=1 Save_SP Total_frame_size=8

Function f() is listed twice and with different lengths.
Sadly in this example f() starts at offset 0. I think if you tweak
the example, try to see what you get when the start of f() is not zero.

Helge
/who has to run now...

[-- Attachment #2: t1.c --]
[-- Type: text/plain, Size: 152 bytes --]

int a(void)
{
	return 1;
}

int __attribute__((weak)) f(int x)
{
	return 0;
}

int z(void)
{
	return 2;
}

int main(void)
{
	return a() + f(0) + z();
}

[-- Attachment #3: t2.c --]
[-- Type: text/plain, Size: 30 bytes --]

int f(int x)
{
	return 500;
}

  reply	other threads:[~2009-10-28 22:59 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26 22:21 Out of order unwind entry warning Helge Deller
2009-10-26 23:41 ` Kyle McMartin
2009-10-27  1:50   ` Randolph Chung
2009-10-27  2:24     ` Kyle McMartin
2009-10-27 23:19 ` John David Anglin
2009-10-28 21:42   ` Helge Deller
2009-10-28 22:00     ` Helge Deller
2009-10-28 23:10       ` John David Anglin
2009-10-29 20:51         ` Helge Deller
2009-10-29 13:20       ` Carlos O'Donell
2009-10-28 22:18     ` John David Anglin
2009-10-28 22:43       ` Helge Deller
2009-10-28 22:59         ` Helge Deller [this message]
2009-10-29  2:11           ` John David Anglin
2009-10-29 16:38             ` John David Anglin
2009-10-29 19:16           ` John David Anglin
2009-10-29 20:46             ` Helge Deller
2009-10-29 21:07               ` John David Anglin
2009-10-29 22:22                 ` Helge Deller
2009-10-29 23:35                   ` John David Anglin
2009-10-30 22:47                     ` Helge Deller
2009-10-31  0:41                       ` John David Anglin
2009-10-31  2:19                         ` John David Anglin
2009-10-31  7:39                           ` Helge Deller
2009-11-01 23:16                       ` John David Anglin
2009-11-02  1:40                         ` John David Anglin
2009-11-02  2:34                           ` John David Anglin
2009-11-02 21:02                             ` Helge Deller
2009-11-02 21:50                               ` John David Anglin
2009-11-02 22:20                                 ` Helge Deller
2009-11-02 22:31                                   ` James Bottomley
2009-11-02 22:43                                     ` Helge Deller
2009-11-02 22:52                                   ` Helge Deller
2009-11-02 23:23                                     ` John David Anglin
2009-11-03 21:10                                       ` Helge Deller
2009-11-03 21:36                                         ` John David Anglin
2009-11-03 21:43                                           ` Helge Deller
2009-11-03 21:54                                             ` John David Anglin
2009-11-03 22:04                                               ` Helge Deller
2009-11-04  0:57                                                 ` John David Anglin
2009-11-06 23:07                                                   ` Helge Deller
2009-11-07 20:11                                                     ` Kyle McMartin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AE8CCE3.1030503@gmx.de \
    --to=deller@gmx.de \
    --cc=carlos@systemhalted.org \
    --cc=dave@hiauly1.hia.nrc.ca \
    --cc=linux-parisc@vger.kernel.org \
    --cc=randolph@tausq.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox