From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15243 invoked by alias); 23 Jul 2007 16:57:38 -0000 Received: (qmail 15232 invoked by uid 22791); 23 Jul 2007 16:57:37 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 23 Jul 2007 16:57:34 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l6NGvWJj020867 for ; Mon, 23 Jul 2007 12:57:32 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l6NGvWvT028486; Mon, 23 Jul 2007 12:57:32 -0400 Received: from [127.0.0.1] (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l6NGvUpt026661; Mon, 23 Jul 2007 12:57:31 -0400 Message-ID: <46A4DE19.4000200@redhat.com> Date: Mon, 23 Jul 2007 16:57:00 -0000 From: Andrew Cagney User-Agent: Thunderbird 1.5.0.12 (X11/20070530) MIME-Version: 1.0 To: frysk@sourceware.org, Roland McGrath Subject: which elf symbol? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00167.txt.bz2 Hi, I've replaced the frysk-stackframe program with an expanded frysk-symbols program that has more elf symbol lookup edge cases; for instance nested symbols. I've also expanded frysk.rt.TestSymbol to exercise them. For some of the cases though, the results are not what I expected. I've noted the failures below and provided a simplified assembler. 1) testGlobalAfterNested(frysk.rt.TestSymbol)junit.framework.ComparisonFailure: symbol global_outer expected: but was: at frysk.rt.TestSymbol.symbolTest(TestRunner) at frysk.rt.TestSymbol.testGlobalAfterNested(TestRunner) at frysk.junit.Runner.runCases(TestRunner) at frysk.junit.Runner.runArchCases(TestRunner) at frysk.junit.Runner.runTestCases(TestRunner) at TestRunner.main(TestRunner) 2) testLocalAfterNested(frysk.rt.TestSymbol)junit.framework.ComparisonFailure: symbol local_outer expected:<...outer> but was:<...st_size_0> at frysk.rt.TestSymbol.symbolTest(TestRunner) at frysk.rt.TestSymbol.testLocalAfterNested(TestRunner) at frysk.junit.Runner.runCases(TestRunner) at frysk.junit.Runner.runArchCases(TestRunner) at frysk.junit.Runner.runTestCases(TestRunner) at TestRunner.main(TestRunner) These two are effectively the same. The layout is: local_st_size_0: // this symbol has no size global_outer: nop local_in_global: nop .size local_in_global, .-local_in_global nop <> .size global_outer, .-global_outer that is global_outer contains a nested symbol but the "pc" is beyond that back in the outer/global symbol. I'm guessing that "global_outer" should be returned. Currently local_st_size_0 is returned :-( 3) testNoSymbolAfterGlobal(frysk.rt.TestSymbol)junit.framework.ComparisonFailure: symbol [unknown] expected:<[unknown]> but was: at frysk.rt.TestSymbol.symbolTest(TestRunner) at frysk.rt.TestSymbol.testNoSymbolAfterGlobal(TestRunner) at frysk.junit.Runner.runCases(TestRunner) at frysk.junit.Runner.runArchCases(TestRunner) at frysk.junit.Runner.runTestCases(TestRunner) at TestRunner.main(TestRunner) 4) testNoSymbolAfterLocal(frysk.rt.TestSymbol)junit.framework.ComparisonFailure: symbol [unknown] expected:<[unknown]> but was: at frysk.rt.TestSymbol.symbolTest(TestRunner) at frysk.rt.TestSymbol.testNoSymbolAfterLocal(TestRunner) at frysk.junit.Runner.runCases(TestRunner) at frysk.junit.Runner.runArchCases(TestRunner) at frysk.junit.Runner.runTestCases(TestRunner) at TestRunner.main(TestRunner) This is the no-symbol case, there is a hole in the memory where there is no valid symbol vis: local_st_size_0: // this symbol has no size global_symbol: nop nop .size global_symbol, .-global_symbol << you are here >> I'm guessing it should not get a symbol at all (the [unknown]). It currently gets the nearest unsized symbol. 5) testGlobalSize0InGlobal(frysk.rt.TestSymbol)junit.framework.ComparisonFailure: symbol global_0_in_global expected:<...0_in_global> but was:<...after_0> at frysk.rt.TestSymbol.symbolTest(TestRunner) at frysk.rt.TestSymbol.testGlobalSize0InGlobal(TestRunner) at frysk.junit.Runner.runCases(TestRunner) at frysk.junit.Runner.runArchCases(TestRunner) at frysk.junit.Runner.runTestCases(TestRunner) at TestRunner.main(TestRunner) 6) testLocalSize0InGlobal(frysk.rt.TestSymbol)junit.framework.ComparisonFailure: symbol local_0_in_global expected: but was: at frysk.rt.TestSymbol.symbolTest(TestRunner) at frysk.rt.TestSymbol.testLocalSize0InGlobal(TestRunner) at frysk.junit.Runner.runCases(TestRunner) at frysk.junit.Runner.runArchCases(TestRunner) at frysk.junit.Runner.runTestCases(TestRunner) at TestRunner.main(TestRunner) 7) testGlobalSize0InLocal(frysk.rt.TestSymbol)junit.framework.ComparisonFailure: symbol global_0_in_local expected: but was: at frysk.rt.TestSymbol.symbolTest(TestRunner) at frysk.rt.TestSymbol.testGlobalSize0InLocal(TestRunner) at frysk.junit.Runner.runCases(TestRunner) at frysk.junit.Runner.runArchCases(TestRunner) at frysk.junit.Runner.runTestCases(TestRunner) at TestRunner.main(TestRunner) 8) testLocalSize0InLocal(frysk.rt.TestSymbol)junit.framework.ComparisonFailure: symbol local_0_in_local expected:<...0_in_local> but was:<...after_0> at frysk.rt.TestSymbol.symbolTest(TestRunner) at frysk.rt.TestSymbol.testLocalSize0InLocal(TestRunner) at frysk.junit.Runner.runCases(TestRunner) at frysk.junit.Runner.runArchCases(TestRunner) at frysk.junit.Runner.runTestCases(TestRunner) at TestRunner.main(TestRunner) These are cases where there is a nested symbol within a sized symbol vis: global_after_0: nop local_0_in_global: << you are here >> nop .size global_after_0, .-global_after_0 here, since the PC is exactly at the unsized local symbol I'm guessing that it should return that. It currently gets the containing sized symbol.