Bug 367371 - DW_AT_MIPS_linkage_name with excessive prefix `*__GI_' in C (glibc-debuginfo)
DW_AT_MIPS_linkage_name with excessive prefix `*__GI_' in C (glibc-debuginfo)
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
8
x86_64 Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
bzcl34nup
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-05 15:16 EST by Jan Kratochvil
Modified: 2008-08-03 00:17 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-08-03 00:17:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Kratochvil 2007-11-05 15:16:52 EST
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 12:22:08 EST
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 10:25:53 EDT
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 00:17:15 EDT
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.