Bug 30658 - LoongArch: ld.so segfaults when tracing
Summary: LoongArch: ld.so segfaults when tracing
Status: UNCONFIRMED
Alias: None
Product: glibc
Classification: Unclassified
Component: dynamic-link (show other bugs)
Version: 2.37
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-20 11:38 UTC by Alexey Sheplyakov
Modified: 2023-07-22 13:05 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
patch (965 bytes, patch)
2023-07-20 11:38 UTC, Alexey Sheplyakov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Sheplyakov 2023-07-20 11:38:57 UTC
Created attachment 14991 [details]
patch

cat > test.c <<EOF
struct THD;
extern __thread struct THD *current_thd;
void *test() { return current_thd; }
EOF
    
gcc -ftls-model=initial-exec -shared -fPIC -o libtest.so test.c
env LD_TRACE_LOADED_OBJECTS=1 LD_WARN=1 LD_BIND_NOW=1 /lib64/ld-linux-loongarch-lp64d.so.1 ./libtest.so
    statically linked
undefined symbol: current_thd   (./libtest.so)
Segmentation fault
    
This failure is particularly annoying since the above tracing command is used when building RPM packages.
Comment 1 Dmitry V. Levin 2023-07-22 13:05:20 UTC
Per https://sourceware.org/glibc/wiki/Contribution%20checklist, please submit the patch to the mailing list libc-alpha@sourceware.org.