Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 96022 - cryptsetup links to static libgcrypt resulting in TEXTREL
Summary: cryptsetup links to static libgcrypt resulting in TEXTREL
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Other
: High normal
Assignee: Crypto team [DISABLED]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-13 17:22 UTC by Daniel Black (RETIRED)
Modified: 2005-09-04 08:30 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix executable GNU_STACK marking (libgcrypt-1.2.1-GNU-stack-fix.patch,3.66 KB, patch)
2005-08-22 12:35 UTC, PaX Team
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Black (RETIRED) gentoo-dev 2005-06-13 17:22:10 UTC
-ldevmapper /usr/lib/libpopt.a
mkdir .libs
i686-pc-linux-gnu-gcc -O2 -march=athlon-xp -fomit-frame-pointer -pipe -o cryptsetup cryptsetup.o setup.o utils.o backends.o libdevmapper.o gcrypt.o  /usr/lib/libgcrypt.a /usr/lib/libgpg-error.a -ldevmapper /usr/lib/libpopt.a
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object.
make[2]: Leaving directory `/var/tmp/portage/cryptsetup-0.1-r2/work/cryptsetup-0.1/src'
Making all in po


Given it is desireable for libgcypt to be staticly linked - the static libgcrypt library should be compiled with -fPIC.


scanelf -aT /bin/cryptsetup
 TYPE    PAX   STK/REL/PTL TEXTREL RPATH NEEDED INTERP BIND TEXTRELS FILE
        TEXTREL cryptsetup: (NULL: fake?) [0x42EDC] in _gcry_rndlinux_gather_random [0x36A70]
.....
.....
        TEXTREL cryptsetup: free [0x45688] in _gcry_rndlinux_gather_random [0x36A70]
        TEXTREL cryptsetup: free [0x45EF3] in _gcry_rndlinux_gather_random ET_DYN ---xe- RWX R-- RW- TEXTREL   -   libdevmapper.so.1.01,libc.so.6 /lib/ld-linux.so.2 NOW  /bin/cryptsetup
Comment 1 Daniel Black (RETIRED) gentoo-dev 2005-08-20 02:06:51 UTC
Fixed in libgcrypt-1.2.1-r1 (forces --with-pic in configure) 
 
>>> Completed installing cryptsetup-0.1-r2 
into /var/tmp/portage/cryptsetup-0.1-r2/image/ 
 
frog cryptsetup # scanelf 
-aT /var/tmp/portage/cryptsetup-0.1-r2/image/bin/cryptsetup 
 TYPE    PAX   STK/REL/PTL TEXTREL RPATH BIND TEXTRELS FILE 
ET_EXEC ---xe- RWX --- RW-    -      -   
LAZY  /var/tmp/portage/cryptsetup-0.1-r2/image/bin/cryptsetup 
 
qed - problem solved 
 
Comment 2 PaX Team 2005-08-20 17:45:27 UTC
sorry to chime in, but there's still one issue left that should be fixed: the
RWE GNU_STACK segment. there're a bunch of .S files that are apparently not
marked so the resulting library gets the executable stack mark, without really
needing it. the quick fix is execstack -c on the .so, but best is to add the
proper marking to each .S (and upstream is the best place for that).
Comment 3 Daniel Black (RETIRED) gentoo-dev 2005-08-20 21:09:29 UTC
chiming in is ok.  
 
I couldn't find any patches and don't know enough to fix it yet. 
Comment 4 PaX Team 2005-08-22 12:35:38 UTC
Created attachment 66576 [details, diff]
fix executable GNU_STACK marking

the attached patch fixes the executable GNU_STACK marking for i386/i586, the
other archs would need similar patches too.
Comment 5 Daniel Black (RETIRED) gentoo-dev 2005-08-23 06:57:18 UTC
thankyou. 
Comment 6 Daniel Black (RETIRED) gentoo-dev 2005-09-04 08:30:01 UTC
hopefully fixed now. Thanks again.