public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Carlos O'Donell" <carlos@systemhalted.org>
To: John David Anglin <dave.anglin@bell.net>
Cc: linux-parisc <linux-parisc@vger.kernel.org>, libc-ports@sourceware.org
Subject: hppa: glibc and gcc 4.6, "error: _rtld_global_ro causes a section type conflict"
Date: Sun, 15 Apr 2012 15:00:00 -0000	[thread overview]
Message-ID: <CADZpyix39LFL7MccuovarhdbpVCO8aSmBMH1hjK+4bn=ZYsXaA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2104 bytes --]

Dave,

When compiling glibc on magnum with gcc-4.6 I get an odd failure about
section type conflicts.

The following is the reduced test case:

carlos@magnum:~/build/glibc$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/hppa-linux-gnu/4.6/lto-wrapper
Target: hppa-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian
4.6.3-1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --disable-libssp
--enable-plugin --enable-objc-gc --disable-libstdcxx-pch
--enable-checking=release --build=hppa-linux-gnu --host=hppa-linux-gnu
--target=hppa-linux-gnu
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-1)

carlos@magnum:~/src/glibc/elf$ hppa-linux-gnu-gcc rtld.i -c -std=gnu99
-fgnu89-inline -O2 -U_FORTIFY_SOURCE -Wall -Winline -Wwrite-strings
-fmerge-all-constants -fno-stack-protector -g -Wstrict-prototypes
-fPIC -mdisable-fpregs
rtld.c: In function âdl_mainâ:
rtld.c:937:3: warning: implicit declaration of function
â__canonicalize_funcptr_for_compareâ [-Wimplicit-function-declaration]
rtld.c: At top level:
rtld.c:150:23: error: _rtld_global_ro causes a section type conflict
carlos@magnum:~/src/glibc/elf$

Attached is the original unreduced file as rtld.tar.bz2 (modified
slightly to work standalone because glibc uses `-include' on the
command line).

Attached is the multi-delta reduced file as rtld-reduced.i.

Have you seen this before with gcc 4.6?

I'll be poking at this later, but I thought you might have seen this
so I'm posting to the list.

I know that Gentoo/hppa has already seen this issue, but not posted a solution.
https://bugs.gentoo.org/show_bug.cgi?id=405161

Comments?

Cheers,
Carlos.

[-- Attachment #2: rtld.tar.bz2 --]
[-- Type: application/x-bzip2, Size: 54700 bytes --]

[-- Attachment #3: rtld-reduced.i --]
[-- Type: application/octet-stream, Size: 5480 bytes --]

typedef unsigned int size_t;
typedef long int Lmid_t;
typedef unsigned int uint32_t;
__extension__ typedef unsigned long long int uint64_t;
typedef uint32_t Elf32_Word;
typedef uint32_t Elf32_Addr;
typedef struct {
}
Elf32_Sym;
typedef struct {
}
Elf32_Phdr;
typedef struct {
}
Elf32_auxv_t;
extern int _dl_discover_osversion (void) __attribute__ ((visibility ("hidden")));
enum {
  PTHREAD_MUTEX_TIMED_NP,
  PTHREAD_MUTEX_RECURSIVE_NP,
  PTHREAD_MUTEX_ERRORCHECK_NP,
  PTHREAD_MUTEX_ADAPTIVE_NP,
  PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
  PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
  PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
  PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL,
  PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP  
};
struct r_scope_elem {
  struct link_map **r_list;
  unsigned int r_nlist;
};
struct link_map   {
  struct r_scope_elem l_searchlist;
};
extern void _dl_close (void *map) __attribute__ ((visibility ("hidden")));
extern int _dl_catch_error (const char **objname, const char **errstring,        _Bool *mallocedp, void (*operate) (void *),        void *args)      ;
typedef unsigned int fpu_control_t;
typedef struct link_map *lookup_t;
struct rtld_global {
  struct link_map _dl_rtld_map;
  int (*_dl_make_stack_executable_hook) (void **) ;
};
struct rtld_global_ro {
  size_t _dl_pagesize;
  int _dl_debug_fd;
  int _dl_lazy;
  fpu_control_t _dl_fpu_control;
  int _dl_correct_cache_id;
  uint64_t _dl_hwcap_mask;
  Elf32_Addr _dl_use_load_bias;
  void (*_dl_debug_printf) (const char *, ...)        __attribute__ ((__format__ (__printf__, 1, 2)));
  int ( *_dl_catch_error) (const char **, const char **,          _Bool *, void (*) (void *), void *);
  void ( *_dl_signal_error) (int, const char *, const char *,            const char *);
  void (*_dl_mcount) (Elf32_Addr frompc, Elf32_Addr selfpc);
  lookup_t ( *_dl_lookup_symbol_x) (const char *,            struct link_map *,            const Elf32_Sym **,            struct r_scope_elem *[],            const struct r_found_version *,            int, int,            struct link_map *);
  int (*_dl_check_caller) (const void *, enum allowmask);
  void *(*_dl_open) (const char *file, int mode, const void *caller_dlopen,        Lmid_t nsid, int argc, char *argv[], char *env[]);
  void (*_dl_close) (void *map);
  void *(*_dl_tls_get_addr_soft) (struct link_map *);
  int (*_dl_discover_osversion) (void);
  int _dl_pointer_guard;
};
extern int _dl_make_stack_executable (void **stack_endp) ;
extern void _dl_debug_printf (const char *fmt, ...)      __attribute__ ((__format__ (__printf__, 1, 2))) __attribute__ ((visibility ("hidden")));
extern void _dl_signal_error (int errcode, const char *object,          const char *occurred, const char *errstring)      __attribute__ ((__noreturn__)) __attribute__ ((visibility ("hidden")));
extern lookup_t _dl_lookup_symbol_x (const char *undef,          struct link_map *undef_map,          const Elf32_Sym **sym,          struct r_scope_elem *symbol_scope[],          const struct r_found_version *version,          int type_class, int flags,          struct link_map *skip_map)      __attribute__ ((visibility ("hidden")));
extern void _dl_mcount_internal (Elf32_Addr frompc, Elf32_Addr selfpc)      __attribute__ ((visibility ("hidden")));
extern int _dl_check_caller (const void *caller, enum allowmask mask)      __attribute__ ((visibility ("hidden")));
extern void *_dl_open (const char *name, int mode, const void *caller,          Lmid_t nsid, int argc, char *argv[], char *env[])      __attribute__ ((visibility ("hidden")));
extern void *_dl_tls_get_addr_soft (struct link_map *l) __attribute__ ((visibility ("hidden")));
struct rtld_global _rtld_global =   {
};
extern struct rtld_global _rtld_local     __attribute__ ((alias ("_rtld_global"), visibility ("hidden")));
struct rtld_global_ro _rtld_global_ro __attribute__ ((section (".data.rel.ro"))) =   {
  ._dl_debug_fd = 2,
     ._dl_use_load_bias = -2,
     ._dl_correct_cache_id = 3,
     ._dl_hwcap_mask = (0),
     ._dl_lazy = 1,
     ._dl_fpu_control = 0x00000000,
     ._dl_pointer_guard = 1,
     ._dl_pagesize = 4096,
       ._dl_debug_printf = _dl_debug_printf,
     ._dl_catch_error = _dl_catch_error,
     ._dl_signal_error = _dl_signal_error,
     ._dl_mcount = _dl_mcount_internal,
     ._dl_lookup_symbol_x = _dl_lookup_symbol_x,
     ._dl_check_caller = _dl_check_caller,
     ._dl_open = _dl_open,
     ._dl_close = _dl_close,
     ._dl_tls_get_addr_soft = _dl_tls_get_addr_soft,
      ._dl_discover_osversion = _dl_discover_osversion
    };
static void dl_main (const Elf32_Phdr *phdr, Elf32_Word phnum,        Elf32_Addr *user_entry, Elf32_auxv_t *auxv);
struct dl_start_final_info 
{
};
static Elf32_Addr __attribute__ ((noinline)) 
_dl_start_final (void *arg, struct dl_start_final_info *info)  
{
  Elf32_Addr start_addr;
  start_addr = _dl_sysdep_start (arg, &dl_main);
}
static Elf32_Addr __attribute__ ((__used__)) _dl_start (void *arg) 
{
  struct dl_start_final_info info;
  {
    Elf32_Addr entry = _dl_start_final (arg, &info);
  }
}
static void dl_main (const Elf32_Phdr *phdr,   Elf32_Word phnum,   Elf32_Addr *user_entry,   Elf32_auxv_t *auxv) 
{
  struct link_map *main_map;
  unsigned int i;
  _rtld_local._dl_make_stack_executable_hook = &_dl_make_stack_executable;
  for (i = 1;
       i < main_map->l_searchlist.r_nlist;
       ++i)
    if (main_map->l_searchlist.r_list[i] == &_rtld_local._dl_rtld_map)
       break;
}

             reply	other threads:[~2012-04-15 15:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-15 15:00 Carlos O'Donell [this message]
2012-04-24 23:55 ` John David Anglin
2012-04-25  4:06   ` Carlos O'Donell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADZpyix39LFL7MccuovarhdbpVCO8aSmBMH1hjK+4bn=ZYsXaA@mail.gmail.com' \
    --to=carlos@systemhalted.org \
    --cc=dave.anglin@bell.net \
    --cc=libc-ports@sourceware.org \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).