Bug 367371 - DW_AT_MIPS_linkage_name with excessive prefix `*__GI_' in C (glibc-debuginfo)
Summary: DW_AT_MIPS_linkage_name with excessive prefix `*__GI_' in C (glibc-debuginfo)
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 8
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: bzcl34nup
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-05 20:16 UTC by Jan Kratochvil
Modified: 2008-08-03 04:17 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-08-03 04:17:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jan Kratochvil 2007-11-05 20:16:52 UTC
Description of problem:
Upstream GDB needs one of these commands to access `errno' in nonthreaded apps:
  (gdb) print *('*__GI___errno_location')()
or
  (gdb) print *((int *(*)())__errno_location)()

Version-Release number of selected component (if applicable):
gcc-4.1.2-33.x86_64
glibc-debuginfo-2.7-2.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. echo 'int main () {}' >main.c
2. gcc -g -o main main.c
3. upstream/gdb ./main
4. start
5. print *__errno_location()

Actual results:
Cannot access memory at address 0xffffffffaaac3698

Expected results:
$1 = 0

Additional info:
The error is due to `__errno_location' having no debug info and defaulting to:
  (gdb) ptype __errno_location
  type = int ()
as GDB prefers DW_AT_MIPS_linkage_name over DW_AT_name, if present.
But glibc-debuginfo-2.7-2.x86_64 has:
 <1><81a0>: Abbrev Number: 12 (DW_TAG_subprogram)
  <81a2>     DW_AT_name        : (indirect string, offset: 0x280e): __errno_location
  <81a8>     DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808):
*__GI___errno_location
so one needs to use one of the workarounding commands in the Description.

There is now workaround in gdb-6.7.1-3.fc9 to prefer DW_AT_name over
DW_AT_MIPS_linkage_name for plain C Compilation Units.
AFAIK DW_AT_MIPS_linkage_name is so far in use only as an insufficient debuginfo
reading GDB implementation helper for C++ methods.

It may not make sense to fix DW_AT_MIPS_linkage_name as it should rather be
dropped and GDB implementation improved to cope with C++ without it.

Comment 1 Jakub Jelinek 2007-11-06 17:22:08 UTC
That's not a GCC bug.  In glibc we have extern int *__errno_location (void)
__asm ("__GI___errno_location"); and then add an alias in asm, so that calls to
__errno_location from libc.so are binding to the libc.so definition always and
don't go through PLT, while __errno_location is exported.
Current ld has -Bsymbolic-functions and -Bsymbolic-data support, so perhaps
we could use it instead eventually if we fix bugs in it.

Comment 2 Bug Zapper 2008-04-04 14:25:53 UTC
Based on the date this bug was created, it appears to have been reported
during the development of Fedora 8. In order to refocus our efforts as
a project we are changing the version of this bug to '8'.

If this bug still exists in rawhide, please change the version back to
rawhide.
(If you're unable to change the bug's version, add a comment to the bug
and someone will change it for you.)

Thanks for your help and we apologize for the interruption.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 3 Ulrich Drepper 2008-08-03 04:17:15 UTC
We cannot use -Bsymbolic in any form.  The malloc functions must be interceptible.  With gdb working differently now, I assume there is nothing left to do.  If there is, reopen.


Note You need to log in before you can comment on or make changes to this bug.