[Bug dynamic-link/34532] New: oongarch, hppa: ld.so crashes with SIGSEGV in trace mode (ldd -d/-r/-u) on unresolved TLS symbols

"adhemerval.zanella at linaro dot org via Glibc-bugs" <[email protected]>
Newsgroups gmane.comp.lib.glibc.bugs
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34532

            Bug ID: 34532
           Summary: oongarch, hppa: ld.so crashes with SIGSEGV in trace
                    mode (ldd -d/-r/-u) on unresolved TLS symbols
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: adhemerval.zanella at linaro dot org
  Target Milestone: ---

Reproducer

$ cat tls-undef.c
extern __thread int missing_tls;
extern int missing_data;
int f (void) { return missing_tls; }
int g (void) { return missing_data; }
$ gcc -shared -fPIC -o tls-undef.so tls-undef.c

# hppa
$ LD_TRACE_LOADED_OBJECTS=1 LD_WARN=yes /lib/ld.so.1 ./tls-undef.so
        linux-vdso32.so.1 (0xbf673000)
        libc.so.6 => /usr/lib/hppa-linux-gnu/libc.so.6 (0xbed10000)
        /lib/ld.so.1 (0xbf50c000)
undefined symbol: missing_data  (./tls-undef.so)
undefined symbol: missing_tls   (./tls-undef.so)
Segmentation fault         LD_TRACE_LOADED_OBJECTS=1 LD_WARN=yes /lib/ld.so.1
./tls-undef.so

# loongarch
$ LD_TRACE_LOADED_OBJECTS=1 LD_WARN=yes /lib64/ld-linux-loongarch-lp64d.so.1
./tls-undef.so
        /lib64/ld-linux-loongarch-lp64d.so.1 (0x00007ffff0940000)
        linux-vdso.so.1 (0x00007ffffecc8000)
undefined symbol: missing_data  (./tls-undef.so)
undefined symbol: missing_tls   (./tls-undef.so)
Segmentation fault

In trace mode RESOLVE_MAP reports the failed lookup and returns NULL
sym_map/sym, ad the TLS cases don't handle this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.