public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/12497] New: stabs: PIE relocation does not work
@ 2011-02-17 20:41 jan.kratochvil at redhat dot com
  2021-08-11 13:14 ` [Bug symtab/12497] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-02-17 20:41 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12497

           Summary: stabs: PIE relocation does not work
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P3
         Component: symtab
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jan.kratochvil@redhat.com


Tracker for:
KFAIL: gdb.dwarf2/dw2-ranges.exp: info line main3

when compiled with -fPIE -pie.
main3 is always compiled with -gstabs.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug symtab/12497] stabs: PIE relocation does not work
  2011-02-17 20:41 [Bug symtab/12497] New: stabs: PIE relocation does not work jan.kratochvil at redhat dot com
@ 2021-08-11 13:14 ` vries at gcc dot gnu.org
  2021-08-13 14:56 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2021-08-11 13:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12497

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #5)
> https://sourceware.org/ml/gdb-patches/2019-08/msg00361.html

Ended with:
https://sourceware.org/pipermail/gdb-patches/2019-October/161634.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug symtab/12497] stabs: PIE relocation does not work
  2011-02-17 20:41 [Bug symtab/12497] New: stabs: PIE relocation does not work jan.kratochvil at redhat dot com
  2021-08-11 13:14 ` [Bug symtab/12497] " vries at gcc dot gnu.org
@ 2021-08-13 14:56 ` vries at gcc dot gnu.org
  2021-08-23 10:08 ` cvs-commit at gcc dot gnu.org
  2021-08-24  6:40 ` [Bug symtab/12497] gas-stabs: " vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2021-08-13 14:56 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12497

--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
This workaround adds .func (
https://sourceware.org/binutils/docs/as/Func.html#Func ) and allows the test to
pass:
...
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
index 8566e0034cf..8689126214c 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
@@ -36,6 +36,7 @@ standard_testfile .c -2.c -3.c
 set asmfile [standard_output_file ${testfile}.s]
 set asmfile2 [standard_output_file ${testfile}2.s]
 set asmfile3 [standard_output_file ${testfile}3.s]
+set asmfiletmp [standard_output_file ${testfile}tmp.s]
 set objfile [standard_output_file ${testfile}.o]
 set objfile2 [standard_output_file ${testfile}2.o]
 set objfile3 [standard_output_file ${testfile}3.o]
@@ -55,8 +56,15 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile2}"
"${asmfile2}" assembly {}] !=
 # STABS compilation is intentional as it tests the STABS lookup where is no
 # partial_symtab->psymtabs_addrmap supported for that CU (Compilation Unit) in
 # a file containing psymtabs_addrmap-supporting DWARF CUs.
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile3}" "${asmfile3}" assembly {}]
!= ""
-    || [gdb_compile "${asmfile3}" "${objfile3}" object
{additional_flags=-gstabs}] != "" } {
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile3}" "${asmfile3}" assembly {}]
!= "" } {
+    return -1
+}
+
+exec echo ".func main3, main3" >> ${asmfiletmp}
+exec cat ${asmfile3} >> ${asmfiletmp}
+exec mv ${asmfiletmp} ${asmfile3}
+
+if { [gdb_compile "${asmfile3}" "${objfile3}" object
{additional_flags=-gstabs}] != "" } {
     return -1
 }

...


Stabs now contain FUN entry:
...
$ objdump -G outputs/gdb.dwarf2/dw2-ranges/dw2-ranges

outputs/gdb.dwarf2/dw2-ranges/dw2-ranges:     file format elf64-x86-64

Contents of .stab section:

Symnum n_type n_othr n_desc n_value  n_strx String

-1     HdrSym 0      8      0000000000000064 1     
0      SO     0      0      000000000000060c 1     
/home/vries/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-ranges/dw2-ranges3.s
1      LSYM   0      0      0000000000000000 81     void:t1=1
2      FUN    0      2      000000000000060c 91     main3:F1
3      SLINE  0      9      0000000000000000 0      
4      SLINE  0      12     0000000000000001 0      
5      SLINE  0      14     0000000000000004 0      
6      SLINE  0      15     0000000000000005 0      
7      SLINE  0      17     0000000000000006 0      
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug symtab/12497] stabs: PIE relocation does not work
  2011-02-17 20:41 [Bug symtab/12497] New: stabs: PIE relocation does not work jan.kratochvil at redhat dot com
  2021-08-11 13:14 ` [Bug symtab/12497] " vries at gcc dot gnu.org
  2021-08-13 14:56 ` vries at gcc dot gnu.org
@ 2021-08-23 10:08 ` cvs-commit at gcc dot gnu.org
  2021-08-24  6:40 ` [Bug symtab/12497] gas-stabs: " vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-23 10:08 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12497

--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=74cdc3e0888f1ffc3973a4826e85dd32e5a51037

commit 74cdc3e0888f1ffc3973a4826e85dd32e5a51037
Author: Tom de Vries <tdevries@suse.de>
Date:   Mon Aug 23 12:08:25 2021 +0200

    [gdb/testsuite] Use compiler-generated instead of gas-generated stabs

    The test-case gdb.dwarf2/dw2-ranges.exp is the only one in the gdb
testsuite
    that uses gas-generated stabs.

    While the use seems natural alongside the use of gas-generated dwarf in the
    same test-case, there are a few known issues, filed on the gdb side as:
    - PR symtab/12497 - "stabs: PIE relocation does not work"
    - PR symtab/28221 - "[readnow, stabs] FAIL: gdb.dwarf2/dw2-ranges.exp: \
      info line func"
    and on the gas side as:
    - PR gas/28233 - "[gas, --gstabs] Generate stabs more similar to gcc"

    The test-case contains a KFAIL for PR12497, but it's outdated and fails to
    trigger.

    The intention of the test-case is to test gas-generated dwarf, and using
    gcc-generated stabs instead of gas-generated stabs works fine.

    Supporting compiler-generated stabs is already a corner-case for gdb, and
    there's no current commitment/incentive to support/workaround gas-generated
    stabs, which can be considered a corner-case of a corner-case.

    Work around these problem by using compiler-generated stabs in the
test-case.

    Tested on x86_64-linux.

    gdb/testsuite/ChangeLog:

    2021-08-22  Tom de Vries  <tdevries@suse.de>

            * gdb.dwarf2/dw2-ranges.exp: Use compiler-generated stabs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug symtab/12497] gas-stabs: PIE relocation does not work
  2011-02-17 20:41 [Bug symtab/12497] New: stabs: PIE relocation does not work jan.kratochvil at redhat dot com
                   ` (2 preceding siblings ...)
  2021-08-23 10:08 ` cvs-commit at gcc dot gnu.org
@ 2021-08-24  6:40 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2021-08-24  6:40 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12497

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX
            Summary|stabs: PIE relocation does  |gas-stabs: PIE relocation
                   |not work                    |does not work

--- Comment #9 from Tom de Vries <vries at gcc dot gnu.org> ---
The test-case has been updated to not use gas-generated stabs anymore, and the
outdated KFAIL has been removed.

I'm marking this PR resolved-wontfix.

If there's follow-up on PR gas/28233, we can re-introduce gas-generates stabs
to the test-case, using an axis stabs_method=[list compiler assembler].

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-24  6:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-17 20:41 [Bug symtab/12497] New: stabs: PIE relocation does not work jan.kratochvil at redhat dot com
2021-08-11 13:14 ` [Bug symtab/12497] " vries at gcc dot gnu.org
2021-08-13 14:56 ` vries at gcc dot gnu.org
2021-08-23 10:08 ` cvs-commit at gcc dot gnu.org
2021-08-24  6:40 ` [Bug symtab/12497] gas-stabs: " vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).