[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/14798] New: gas mips target generates badly typed symbols

From: bugdal at aerifal dot cx
Subject: [Bug gas/14798] New: gas mips target generates badly typed symbols
Date: Fri, 02 Nov 2012 04:03:33 +0000


             Bug #: 14798
           Summary: gas mips target generates badly typed symbols
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified

Symptom: failure of -Bsymbolic-functions to resolve libgcc references at
link-time under certain circumstances. In particular, Sabotage Linux
(https://github.com/rofl0r/sabotage) ends up building a broken musl libc.so on
MIPS; its dynamic linker attempts to call libgcc functions before symbolic
relocations have been processed.

Cause: When gcc generates calls to libgcc functions for long division, etc., it
adds a .globl directive to the output asm for those functions. This is entirely
unnecessary, but should be harmless. However, the mips target for gas, upon
seeing a .globl directive, adds OBJECT type to the undefined symbol reference
unless there is a .type directive. On other targets, the type remains UNKNOWN.
This in turn prevents the linker's -Bsymbolic-functions option from resolving
the symbol reference at link-time. Assuming libgcc was compiled correctly with
visibility, these functions have hidden visibility and thus they get resolved
at link time anyway; however, if libgcc was built with --disable-shared, they

Really, this bug is an interaction of 3 separate issues in 3 pieces of

1. gcc: outputting useless .globl
2. gas mips target: treating .globl as implying type==OBJECT
3. libgcc: failure to use visibility when --disable-shared is specified

I believe at least numbers 2 and 3, and maybe all three of them, should be
fixed, but only 2 pertains to binutils.

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]