General TC > Programming & Scripting - Unofficial
GCC compiler and linker options
Rich:
Hi andyj
--- Quote from: Rich on March 17, 2020, 10:53:52 AM ---
--- Quote ---How about with larger executable images?
--- End quote ---
Not yet. I'm going to try with lshw and gtk-lshw. The current executables are about 944K and 1228K respectively and were compiled
with the -flto option.
--- End quote ---
Turns out the lshw package ignores any CFLAGS and CXXFLAGS values you set, and I don't feel like breaking the Makefile.
I did do some tests on gpicview. Results are appended to the first 2 posts. There was 1 interesting surprise.
Previous examples had this type of result:
script grabber sstripped -fno-plt sstripped -flto sstripped
elf_i386.xce 48192 16624 47984 16408 40052 16408
elf_i386.xc 44096 12528 43888 12312 35956 12312
elf_i386.xbn 42184 10620 41392 9820 33444 9804Big gain going from .xce (16624) to .xbn (10620). Adding -fno-plt and -flto shrunk it a tiny bit more (9804).
The gpicview program responded differently:
script gpicview sstripped -fno-plt sstripped -flto sstripped
elf_i386.xce 93856 72278 88480 66902 82136 62452
elf_i386.xc 89760 68182 84384 62806 78040 58356
elf_i386.xbn 87416 65782 83256 61622 75728 55988Modest gain going from .xce (72278) to .xbn (65782). Adding -fno-plt and -flto shrunk it quite a bit more (55988).
The 64 bit version of gpicview had similar results:
Modest gain going from .xce (90530) to .xbn (83362). Adding -fno-plt and -flto shrunk it quite a bit more (70096).
jazzbiker:
Hi, Rich!
Thank You for the great investigation on linker scripts properties. You inspire and encourage to continue the haunt. I chose mpg123 package, because repo version is old enough and maybe it is time to refresh it a little, and make some experiments along with.
Frankly speaking the results seems to me quite amazing and somewhat unpredicted, for me personally.
So I took the latest release mpg123-1.15.13 sources from the project site and worked with them. Resulting extension consists not only of the executable binary, but of some shared libs, and this shared libs appeared to behave controversial to binaries. speaking about their sizes.
Let me describe what I was doing. I made 8 variants of mpg123.tcz, using different CFLAGS and LDFLAGS, following Your advices. Then I packed all of them into 8 different extensions and used them later for memory consumption and performance testing.
The log and information about build process and sizes is the next:
--- Code: ---Target=mpg123.1
CFLAGS=-march=i486 -mtune=i686
LDFLAGS=
real 2m 28.56s
user 2m 16.84s
sys 0m 13.23s
-rwxr-xr-x 1 root root 123120 Apr 21 16:27 /tmp/mpg123.1/usr/local/bin/mpg123
-rwxr-xr-x 1 root root 325688 Apr 21 16:27 /tmp/mpg123.1/usr/local/lib/libmpg123.so
-rwxr-xr-x 1 root root 49408 Apr 21 16:27 /tmp/mpg123.1/usr/local/lib/libout123.so
-rwxr-xr-x 1 root root 12452 Apr 21 16:27 /tmp/mpg123.1/usr/local/lib/mpg123/output_alsa.so
-rwxr-xr-x 1 root root 12340 Apr 21 16:27 /tmp/mpg123.1/usr/local/lib/mpg123/output_dummy.so
-rw-r--r-- 1 tc staff 253952 Apr 21 16:27 ./mpg123.1.tcz
Target=mpg123.2
CFLAGS=-march=i486 -mtune=i686
LDFLAGS=-Wl,-T/usr/local/lib/ldscripts/elf_i386.xbn
real 2m 27.87s
user 2m 16.69s
sys 0m 12.89s
-rwxr-xr-x 1 root root 114704 Apr 21 16:33 /tmp/mpg123.2/usr/local/bin/mpg123
-rwxr-xr-x 1 root root 318776 Apr 21 16:33 /tmp/mpg123.2/usr/local/lib/libmpg123.so
-rwxr-xr-x 1 root root 42344 Apr 21 16:33 /tmp/mpg123.2/usr/local/lib/libout123.so
-rwxr-xr-x 1 root root 8404 Apr 21 16:33 /tmp/mpg123.2/usr/local/lib/mpg123/output_alsa.so
-rwxr-xr-x 1 root root 1916 Apr 21 16:33 /tmp/mpg123.2/usr/local/lib/mpg123/output_dummy.so
-rw-r--r-- 1 tc staff 253952 Apr 21 16:33 ./mpg123.2.tcz
Target=mpg123.3
CFLAGS=-march=i486 -mtune=i686 -flto
LDFLAGS=
real 2m 50.05s
user 2m 36.95s
sys 0m 14.42s
-rwxr-xr-x 1 root root 118156 Apr 21 16:39 /tmp/mpg123.3/usr/local/bin/mpg123
-rwxr-xr-x 1 root root 346104 Apr 21 16:39 /tmp/mpg123.3/usr/local/lib/libmpg123.so
-rwxr-xr-x 1 root root 57584 Apr 21 16:39 /tmp/mpg123.3/usr/local/lib/libout123.so
-rwxr-xr-x 1 root root 12440 Apr 21 16:39 /tmp/mpg123.3/usr/local/lib/mpg123/output_alsa.so
-rwxr-xr-x 1 root root 12328 Apr 21 16:39 /tmp/mpg123.3/usr/local/lib/mpg123/output_dummy.so
-rw-r--r-- 1 tc staff 266240 Apr 21 16:39 ./mpg123.3.tcz
Target=mpg123.4
CFLAGS=-march=i486 -mtune=i686 -flto
LDFLAGS=-Wl,-T/usr/local/lib/ldscripts/elf_i386.xbn
real 2m 49.30s
user 2m 36.62s
sys 0m 14.24s
-rwxr-xr-x 1 root root 109068 Apr 21 16:45 /tmp/mpg123.4/usr/local/bin/mpg123
-rwxr-xr-x 1 root root 343032 Apr 21 16:45 /tmp/mpg123.4/usr/local/lib/libmpg123.so
-rwxr-xr-x 1 root root 50576 Apr 21 16:45 /tmp/mpg123.4/usr/local/lib/libout123.so
-rwxr-xr-x 1 root root 8008 Apr 21 16:45 /tmp/mpg123.4/usr/local/lib/mpg123/output_alsa.so
-rwxr-xr-x 1 root root 1492 Apr 21 16:45 /tmp/mpg123.4/usr/local/lib/mpg123/output_dummy.so
-rw-r--r-- 1 tc staff 266240 Apr 21 16:45 ./mpg123.4.tcz
Target=mpg123.5
CFLAGS=-march=i486 -mtune=i686 -flto -pipe
LDFLAGS=
real 2m 49.41s
user 2m 38.74s
sys 0m 14.56s
-rwxr-xr-x 1 root root 118156 Apr 21 16:51 /tmp/mpg123.5/usr/local/bin/mpg123
-rwxr-xr-x 1 root root 346104 Apr 21 16:51 /tmp/mpg123.5/usr/local/lib/libmpg123.so
-rwxr-xr-x 1 root root 57584 Apr 21 16:51 /tmp/mpg123.5/usr/local/lib/libout123.so
-rwxr-xr-x 1 root root 12440 Apr 21 16:51 /tmp/mpg123.5/usr/local/lib/mpg123/output_alsa.so
-rwxr-xr-x 1 root root 12328 Apr 21 16:51 /tmp/mpg123.5/usr/local/lib/mpg123/output_dummy.so
-rw-r--r-- 1 tc staff 266240 Apr 21 16:51 ./mpg123.5.tcz
Target=mpg123.6
CFLAGS=-march=i486 -mtune=i686 -flto -pipe
LDFLAGS=-Wl,-T/usr/local/lib/ldscripts/elf_i386.xbn
real 2m 49.54s
user 2m 38.81s
sys 0m 14.59s
-rwxr-xr-x 1 root root 109068 Apr 21 16:56 /tmp/mpg123.6/usr/local/bin/mpg123
-rwxr-xr-x 1 root root 343032 Apr 21 16:56 /tmp/mpg123.6/usr/local/lib/libmpg123.so
-rwxr-xr-x 1 root root 50576 Apr 21 16:56 /tmp/mpg123.6/usr/local/lib/libout123.so
-rwxr-xr-x 1 root root 8008 Apr 21 16:56 /tmp/mpg123.6/usr/local/lib/mpg123/output_alsa.so
-rwxr-xr-x 1 root root 1492 Apr 21 16:56 /tmp/mpg123.6/usr/local/lib/mpg123/output_dummy.so
-rw-r--r-- 1 tc staff 266240 Apr 21 16:56 ./mpg123.6.tcz
Target=mpg123.7
CFLAGS=-march=i486 -mtune=i686 -flto -pipe -fno-plt
LDFLAGS=
real 2m 46.47s
user 2m 35.82s
sys 0m 14.51s
-rwxr-xr-x 1 root root 113420 Apr 21 17:02 /tmp/mpg123.7/usr/local/bin/mpg123
-rwxr-xr-x 1 root root 345752 Apr 21 17:02 /tmp/mpg123.7/usr/local/lib/libmpg123.so
-rwxr-xr-x 1 root root 57360 Apr 21 17:02 /tmp/mpg123.7/usr/local/lib/libout123.so
-rwxr-xr-x 1 root root 12328 Apr 21 17:02 /tmp/mpg123.7/usr/local/lib/mpg123/output_alsa.so
-rwxr-xr-x 1 root root 12328 Apr 21 17:02 /tmp/mpg123.7/usr/local/lib/mpg123/output_dummy.so
-rw-r--r-- 1 tc staff 262144 Apr 21 17:02 ./mpg123.7.tcz
Target=mpg123.8
CFLAGS=-march=i486 -mtune=i686 -flto -pipe -fno-plt
LDFLAGS=-Wl,-T/usr/local/lib/ldscripts/elf_i386.xbn
real 2m 45.88s
user 2m 35.56s
sys 0m 14.40s
-rwxr-xr-x 1 root root 107436 Apr 21 17:06 /tmp/mpg123.8/usr/local/bin/mpg123
-rwxr-xr-x 1 root root 341848 Apr 21 17:06 /tmp/mpg123.8/usr/local/lib/libmpg123.so
-rwxr-xr-x 1 root root 50392 Apr 21 17:06 /tmp/mpg123.8/usr/local/lib/libout123.so
-rwxr-xr-x 1 root root 7600 Apr 21 17:06 /tmp/mpg123.8/usr/local/lib/mpg123/output_alsa.so
-rwxr-xr-x 1 root root 1492 Apr 21 17:06 /tmp/mpg123.8/usr/local/lib/mpg123/output_dummy.so
-rw-r--r-- 1 tc staff 262144 Apr 21 17:06 ./mpg123.8.tcz
--- End code ---
For each set of CFLAGS and LDFLAGS compile time is given (this was andyj asked for) and sizes of resulting binaries and shared libs, and the resulting extension size.
Data were collected using script
--- Code: ---#!/bin/sh
#
# CFLAGS ans LDFLAGS are set manually before the script execution
# install dir name is the parameter
OUT_DIR=${1:-"mpg123"}
LOGFILE="/home/tc/c/mpg123/build.log"
echo Target=$OUT_DIR >> "$LOGFILE"
echo CFLAGS=$CFLAGS >> "$LOGFILE"
echo LDFLAGS=$LDFLAGS >> "$LOGFILE"
echo >> "$LOGFILE"
tce-load -i compiletc alsa-dev sstrip squashfs-tools
cd /tmp
sudo rm -r "$OUT_DIR"
cd mpg123-1.25.13
make clean
./configure --with-audio=alsa --with-default-audio=alsa
time -a -o "$LOGFILE" make
sudo make DESTDIR=/tmp/"$OUT_DIR" install
sudo rm -r /tmp/"$OUT_DIR"/usr/local/include
sudo rm -r /tmp/"$OUT_DIR"/usr/local/share
sudo rm -r /tmp/"$OUT_DIR"/usr/local/lib/pkgconfig
sudo find /tmp/"$OUT_DIR"/usr/local/bin -type f -a ! -name "mpg123" -delete
sudo find /tmp/"$OUT_DIR"/usr/local/bin -exec sstrip {} +
sudo find -L /tmp/"$OUT_DIR"/usr/local/lib -type f -a -name "*.so" -exec sstrip {} +
cd /tmp
rm -f "$OUT_DIR".tcz
mksquashfs "$OUT_DIR" "$OUT_DIR".tcz
echo >> "$LOGFILE"
find /tmp/"$OUT_DIR"/usr/local/bin -type f -exec ls -l {} + >> "$LOGFILE"
find -L /tmp/"$OUT_DIR"/usr/local/lib -type f -a -name "*.so" -exec ls -lL {} + >> "$LOGFILE"
echo >> "$LOGFILE"
find . -name "$OUT_DIR.tcz" -exec ls -l {} + >> "$LOGFILE"
echo >> "$LOGFILE"
cd ~/c/mpg123
--- End code ---
So whats amazing:
1. The smallest extension produced without any optimization options!
2. The more optimization options, the less are executables and the greater are shared libs!
I've made memory and performance tests, if You are intersted I can share the results, they are interesting too, but this sizes astonished me.
Regards!
Rich:
Hi jazzbiker
--- Quote from: jazzbiker on April 21, 2020, 12:49:04 PM --- ... 1. The smallest extension produced without any optimization options! ...
--- End quote ---
Long answer:
The squashfs is a compressed filesystem. Compression relies on finding repeating sequences of bytes and replacing them with
smaller sequences of bytes. With no optimization, all instructions follow the same path as the source code, and there will be
repetition in the sequences of bytes produced. Optimization tends to remove a lot of that repetition, especially when using the
-Os flag. If you ever look at the assembly language listing gcc produces, you'll see what at first appears to be very bizarre code.
Things being loaded or jumps being taken for no apparent reason. If you sit down and examine the assembly language listing
carefully, you'll see the gcc maintainers have very clever and sneaky ways of optimizing the code. In fact, in order to run gdb
on a program, you need to disable optimizations in order to trace the program properly.
Short answer:
Optimizations for size naturally compress an executable. Trying to compress a compressed file results in a larger file.
jazzbiker:
Hi, Rich!
Perhaps, the example of mpg123 is not well suited for compilation options testing, because shared libraries of this package are assembler-optimized for various processors' commands sets, that's why compiler has nothing to do with such a code.
Nevertheless I will post the test results, maybe this will be interesting as some showcase.
Extensions were tested using script:
--- Code: ---#!/bin/sh
DECODE_LOG="decode.log"
TOP_LOG="top.log"
ROLLUP_LOG="rollup.log"
SMAPS_LOG="smaps.log"
#determining what mpg123 variant is installed
ls -d /tmp/tcloop/mpg123* >> "$DECODE_LOG"
echo >> "$DECODE_LOG"
#testing decode time of certain .mp3 file
time -a -o "$DECODE_LOG" mpg123 -s /tmp/*.mp3 > /dev/null
echo >> "$DECODE_LOG"
echo >> "$DECODE_LOG"
#starting mpg123 in separate terminal
urxvt -e mpg123 /tmp/*.mp3 &
sleep 5
ls -d /tmp/tcloop/mpg123* >> "$TOP_LOG"
echo >> "$TOP_LOG"
#listing brief memory usage
top -m -n 1 | sed -n -e '4p' -e '/urxvt/d' -e '/sed/d' -e '/mpg123/p' >> "$TOP_LOG"
echo >> "$TOP_LOG"
echo >> "$TOP_LOG"
ls -d /tmp/tcloop/mpg123* >> "$ROLLUP_LOG"
echo >> "$ROLLUP_LOG"
cat /proc/"$(pidof mpg123)"/smaps_rollup >> "$ROLLUP_LOG"
echo >> "$ROLLUP_LOG"
echo >> "$ROLLUP_LOG"
ls -d /tmp/tcloop/mpg123* >> "$SMAPS_LOG"
echo >> "$SMAPS_LOG"
cat /proc/"$(pidof mpg123)"/smaps >> "$SMAPS_LOG"
echo >> "$SMAPS_LOG"
echo >> "$SMAPS_LOG"
--- End code ---
Times used for certain file decoding are in 'decode.log':
--- Code: ---/tmp/tcloop/mpg123.1
real 0m 3.73s
user 0m 3.43s
sys 0m 0.29s
/tmp/tcloop/mpg123.2
real 0m 3.77s
user 0m 3.46s
sys 0m 0.29s
/tmp/tcloop/mpg123.3
real 0m 3.76s
user 0m 3.45s
sys 0m 0.29s
/tmp/tcloop/mpg123.4
real 0m 3.72s
user 0m 3.40s
sys 0m 0.31s
/tmp/tcloop/mpg123.5
real 0m 3.76s
user 0m 3.43s
sys 0m 0.30s
/tmp/tcloop/mpg123.6
real 0m 3.75s
user 0m 3.47s
sys 0m 0.26s
/tmp/tcloop/mpg123.7
real 0m 3.80s
user 0m 3.47s
sys 0m 0.31s
/tmp/tcloop/mpg123.8
real 0m 3.79s
user 0m 3.46s
sys 0m 0.31s
--- End code ---
and shows almost no difference.
top.log and rollup.log are not informative, so I will skip them.
smaps.log was filtered using:
--- Code: ---cat smaps.log | grep -A 1 -e 'mpg123' > smaps.filtered.log
--- End code ---
and shows the same picture as seen from file sizes:
--- Code: ---/tmp/tcloop/mpg123.1
08048000-0804b000 r--p 00000000 07:55 4 /tmp/tcloop/mpg123.1/usr/local/bin/mpg123
Size: 12 kB
--
0804b000-0805e000 r-xp 00003000 07:55 4 /tmp/tcloop/mpg123.1/usr/local/bin/mpg123
Size: 76 kB
--
0805e000-08065000 r--p 00016000 07:55 4 /tmp/tcloop/mpg123.1/usr/local/bin/mpg123
Size: 28 kB
--
08065000-08066000 r--p 0001c000 07:55 4 /tmp/tcloop/mpg123.1/usr/local/bin/mpg123
Size: 4 kB
--
08066000-08068000 rw-p 0001d000 07:55 4 /tmp/tcloop/mpg123.1/usr/local/bin/mpg123
Size: 8 kB
--
b7f08000-b7f0a000 r--p 00000000 07:55 13 /tmp/tcloop/mpg123.1/usr/local/lib/libout123.so.0.2.2
Size: 8 kB
--
b7f0a000-b7f12000 r-xp 00002000 07:55 13 /tmp/tcloop/mpg123.1/usr/local/lib/libout123.so.0.2.2
Size: 32 kB
--
b7f12000-b7f14000 r--p 0000a000 07:55 13 /tmp/tcloop/mpg123.1/usr/local/lib/libout123.so.0.2.2
Size: 8 kB
--
b7f14000-b7f15000 r--p 0000b000 07:55 13 /tmp/tcloop/mpg123.1/usr/local/lib/libout123.so.0.2.2
Size: 4 kB
--
b7f15000-b7f16000 rw-p 0000c000 07:55 13 /tmp/tcloop/mpg123.1/usr/local/lib/libout123.so.0.2.2
Size: 4 kB
--
b7f16000-b7f1a000 r--p 00000000 07:55 9 /tmp/tcloop/mpg123.1/usr/local/lib/libmpg123.so.0.44.10
Size: 16 kB
--
b7f1a000-b7f5c000 r-xp 00004000 07:55 9 /tmp/tcloop/mpg123.1/usr/local/lib/libmpg123.so.0.44.10
Size: 264 kB
--
b7f5c000-b7f65000 r--p 00046000 07:55 9 /tmp/tcloop/mpg123.1/usr/local/lib/libmpg123.so.0.44.10
Size: 36 kB
--
b7f65000-b7f66000 r--p 0004e000 07:55 9 /tmp/tcloop/mpg123.1/usr/local/lib/libmpg123.so.0.44.10
Size: 4 kB
--
b7f66000-b7f67000 rw-p 0004f000 07:55 9 /tmp/tcloop/mpg123.1/usr/local/lib/libmpg123.so.0.44.10
Size: 4 kB
--
b7f7b000-b7f7c000 r--p 00000000 07:55 15 /tmp/tcloop/mpg123.1/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f7c000-b7f7d000 r-xp 00001000 07:55 15 /tmp/tcloop/mpg123.1/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f7d000-b7f7e000 r--p 00002000 07:55 15 /tmp/tcloop/mpg123.1/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f7e000-b7f7f000 r--p 00002000 07:55 15 /tmp/tcloop/mpg123.1/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f7f000-b7f80000 rw-p 00003000 07:55 15 /tmp/tcloop/mpg123.1/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
/tmp/tcloop/mpg123.2
08048000-08065000 rwxp 00000000 07:55 4 /tmp/tcloop/mpg123.2/usr/local/bin/mpg123
Size: 116 kB
--
b7eba000-b7ec5000 rwxp 00000000 07:55 13 /tmp/tcloop/mpg123.2/usr/local/lib/libout123.so.0.2.2
Size: 44 kB
--
b7ec5000-b7f13000 rwxp 00000000 07:55 9 /tmp/tcloop/mpg123.2/usr/local/lib/libmpg123.so.0.44.10
Size: 312 kB
--
b7f29000-b7f2c000 rwxp 00000000 07:55 15 /tmp/tcloop/mpg123.2/usr/local/lib/mpg123/output_alsa.so
Size: 12 kB
--
/tmp/tcloop/mpg123.3
08048000-0804b000 r--p 00000000 07:55 4 /tmp/tcloop/mpg123.3/usr/local/bin/mpg123
Size: 12 kB
--
0804b000-0805d000 r-xp 00003000 07:55 4 /tmp/tcloop/mpg123.3/usr/local/bin/mpg123
Size: 72 kB
--
0805d000-08064000 r--p 00015000 07:55 4 /tmp/tcloop/mpg123.3/usr/local/bin/mpg123
Size: 28 kB
--
08064000-08065000 r--p 0001b000 07:55 4 /tmp/tcloop/mpg123.3/usr/local/bin/mpg123
Size: 4 kB
--
08065000-08066000 rw-p 0001c000 07:55 4 /tmp/tcloop/mpg123.3/usr/local/bin/mpg123
Size: 4 kB
--
b7e84000-b7e86000 r--p 00000000 07:55 13 /tmp/tcloop/mpg123.3/usr/local/lib/libout123.so.0.2.2
Size: 8 kB
--
b7e86000-b7e90000 r-xp 00002000 07:55 13 /tmp/tcloop/mpg123.3/usr/local/lib/libout123.so.0.2.2
Size: 40 kB
--
b7e90000-b7e92000 r--p 0000c000 07:55 13 /tmp/tcloop/mpg123.3/usr/local/lib/libout123.so.0.2.2
Size: 8 kB
--
b7e92000-b7e93000 r--p 0000d000 07:55 13 /tmp/tcloop/mpg123.3/usr/local/lib/libout123.so.0.2.2
Size: 4 kB
--
b7e93000-b7e94000 rw-p 0000e000 07:55 13 /tmp/tcloop/mpg123.3/usr/local/lib/libout123.so.0.2.2
Size: 4 kB
--
b7e94000-b7e97000 r--p 00000000 07:55 9 /tmp/tcloop/mpg123.3/usr/local/lib/libmpg123.so.0.44.10
Size: 12 kB
--
b7e97000-b7edf000 r-xp 00003000 07:55 9 /tmp/tcloop/mpg123.3/usr/local/lib/libmpg123.so.0.44.10
Size: 288 kB
--
b7edf000-b7ee8000 r--p 0004b000 07:55 9 /tmp/tcloop/mpg123.3/usr/local/lib/libmpg123.so.0.44.10
Size: 36 kB
--
b7ee8000-b7ee9000 r--p 00053000 07:55 9 /tmp/tcloop/mpg123.3/usr/local/lib/libmpg123.so.0.44.10
Size: 4 kB
--
b7ee9000-b7eea000 rw-p 00054000 07:55 9 /tmp/tcloop/mpg123.3/usr/local/lib/libmpg123.so.0.44.10
Size: 4 kB
--
b7efe000-b7eff000 r--p 00000000 07:55 15 /tmp/tcloop/mpg123.3/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7eff000-b7f00000 r-xp 00001000 07:55 15 /tmp/tcloop/mpg123.3/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f00000-b7f01000 r--p 00002000 07:55 15 /tmp/tcloop/mpg123.3/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f01000-b7f02000 r--p 00002000 07:55 15 /tmp/tcloop/mpg123.3/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f02000-b7f03000 rw-p 00003000 07:55 15 /tmp/tcloop/mpg123.3/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
/tmp/tcloop/mpg123.4
08048000-08063000 rwxp 00000000 07:55 4 /tmp/tcloop/mpg123.4/usr/local/bin/mpg123
Size: 108 kB
--
b7ea1000-b7eae000 rwxp 00000000 07:55 13 /tmp/tcloop/mpg123.4/usr/local/lib/libout123.so.0.2.2
Size: 52 kB
--
b7eae000-b7f02000 rwxp 00000000 07:55 9 /tmp/tcloop/mpg123.4/usr/local/lib/libmpg123.so.0.44.10
Size: 336 kB
--
b7f19000-b7f1b000 rwxp 00000000 07:55 15 /tmp/tcloop/mpg123.4/usr/local/lib/mpg123/output_alsa.so
Size: 8 kB
--
/tmp/tcloop/mpg123.5
08048000-0804b000 r--p 00000000 07:55 4 /tmp/tcloop/mpg123.5/usr/local/bin/mpg123
Size: 12 kB
--
0804b000-0805d000 r-xp 00003000 07:55 4 /tmp/tcloop/mpg123.5/usr/local/bin/mpg123
Size: 72 kB
--
0805d000-08064000 r--p 00015000 07:55 4 /tmp/tcloop/mpg123.5/usr/local/bin/mpg123
Size: 28 kB
--
08064000-08065000 r--p 0001b000 07:55 4 /tmp/tcloop/mpg123.5/usr/local/bin/mpg123
Size: 4 kB
--
08065000-08066000 rw-p 0001c000 07:55 4 /tmp/tcloop/mpg123.5/usr/local/bin/mpg123
Size: 4 kB
--
b7f23000-b7f25000 r--p 00000000 07:55 13 /tmp/tcloop/mpg123.5/usr/local/lib/libout123.so.0.2.2
Size: 8 kB
--
b7f25000-b7f2f000 r-xp 00002000 07:55 13 /tmp/tcloop/mpg123.5/usr/local/lib/libout123.so.0.2.2
Size: 40 kB
--
b7f2f000-b7f31000 r--p 0000c000 07:55 13 /tmp/tcloop/mpg123.5/usr/local/lib/libout123.so.0.2.2
Size: 8 kB
--
b7f31000-b7f32000 r--p 0000d000 07:55 13 /tmp/tcloop/mpg123.5/usr/local/lib/libout123.so.0.2.2
Size: 4 kB
--
b7f32000-b7f33000 rw-p 0000e000 07:55 13 /tmp/tcloop/mpg123.5/usr/local/lib/libout123.so.0.2.2
Size: 4 kB
--
b7f33000-b7f36000 r--p 00000000 07:55 9 /tmp/tcloop/mpg123.5/usr/local/lib/libmpg123.so.0.44.10
Size: 12 kB
--
b7f36000-b7f7e000 r-xp 00003000 07:55 9 /tmp/tcloop/mpg123.5/usr/local/lib/libmpg123.so.0.44.10
Size: 288 kB
--
b7f7e000-b7f87000 r--p 0004b000 07:55 9 /tmp/tcloop/mpg123.5/usr/local/lib/libmpg123.so.0.44.10
Size: 36 kB
--
b7f87000-b7f88000 r--p 00053000 07:55 9 /tmp/tcloop/mpg123.5/usr/local/lib/libmpg123.so.0.44.10
Size: 4 kB
--
b7f88000-b7f89000 rw-p 00054000 07:55 9 /tmp/tcloop/mpg123.5/usr/local/lib/libmpg123.so.0.44.10
Size: 4 kB
--
b7f9d000-b7f9e000 r--p 00000000 07:55 15 /tmp/tcloop/mpg123.5/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f9e000-b7f9f000 r-xp 00001000 07:55 15 /tmp/tcloop/mpg123.5/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f9f000-b7fa0000 r--p 00002000 07:55 15 /tmp/tcloop/mpg123.5/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7fa0000-b7fa1000 r--p 00002000 07:55 15 /tmp/tcloop/mpg123.5/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7fa1000-b7fa2000 rw-p 00003000 07:55 15 /tmp/tcloop/mpg123.5/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
/tmp/tcloop/mpg123.6
08048000-08063000 rwxp 00000000 07:55 4 /tmp/tcloop/mpg123.6/usr/local/bin/mpg123
Size: 108 kB
--
b7f5d000-b7f6a000 rwxp 00000000 07:55 13 /tmp/tcloop/mpg123.6/usr/local/lib/libout123.so.0.2.2
Size: 52 kB
--
b7f6a000-b7fbe000 rwxp 00000000 07:55 9 /tmp/tcloop/mpg123.6/usr/local/lib/libmpg123.so.0.44.10
Size: 336 kB
--
b7fd5000-b7fd7000 rwxp 00000000 07:55 15 /tmp/tcloop/mpg123.6/usr/local/lib/mpg123/output_alsa.so
Size: 8 kB
--
/tmp/tcloop/mpg123.7
08048000-0804b000 r--p 00000000 07:55 4 /tmp/tcloop/mpg123.7/usr/local/bin/mpg123
Size: 12 kB
--
0804b000-0805c000 r-xp 00003000 07:55 4 /tmp/tcloop/mpg123.7/usr/local/bin/mpg123
Size: 68 kB
--
0805c000-08063000 r--p 00014000 07:55 4 /tmp/tcloop/mpg123.7/usr/local/bin/mpg123
Size: 28 kB
--
08063000-08064000 r--p 0001a000 07:55 4 /tmp/tcloop/mpg123.7/usr/local/bin/mpg123
Size: 4 kB
--
08064000-08065000 rw-p 0001b000 07:55 4 /tmp/tcloop/mpg123.7/usr/local/bin/mpg123
Size: 4 kB
--
b7efe000-b7f00000 r--p 00000000 07:55 13 /tmp/tcloop/mpg123.7/usr/local/lib/libout123.so.0.2.2
Size: 8 kB
--
b7f00000-b7f0a000 r-xp 00002000 07:55 13 /tmp/tcloop/mpg123.7/usr/local/lib/libout123.so.0.2.2
Size: 40 kB
--
b7f0a000-b7f0c000 r--p 0000c000 07:55 13 /tmp/tcloop/mpg123.7/usr/local/lib/libout123.so.0.2.2
Size: 8 kB
--
b7f0c000-b7f0d000 r--p 0000d000 07:55 13 /tmp/tcloop/mpg123.7/usr/local/lib/libout123.so.0.2.2
Size: 4 kB
--
b7f0d000-b7f0e000 rw-p 0000e000 07:55 13 /tmp/tcloop/mpg123.7/usr/local/lib/libout123.so.0.2.2
Size: 4 kB
--
b7f0e000-b7f11000 r--p 00000000 07:55 9 /tmp/tcloop/mpg123.7/usr/local/lib/libmpg123.so.0.44.10
Size: 12 kB
--
b7f11000-b7f59000 r-xp 00003000 07:55 9 /tmp/tcloop/mpg123.7/usr/local/lib/libmpg123.so.0.44.10
Size: 288 kB
--
b7f59000-b7f62000 r--p 0004b000 07:55 9 /tmp/tcloop/mpg123.7/usr/local/lib/libmpg123.so.0.44.10
Size: 36 kB
--
b7f62000-b7f63000 r--p 00053000 07:55 9 /tmp/tcloop/mpg123.7/usr/local/lib/libmpg123.so.0.44.10
Size: 4 kB
--
b7f63000-b7f64000 rw-p 00054000 07:55 9 /tmp/tcloop/mpg123.7/usr/local/lib/libmpg123.so.0.44.10
Size: 4 kB
--
b7f78000-b7f79000 r--p 00000000 07:55 15 /tmp/tcloop/mpg123.7/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f79000-b7f7a000 r-xp 00001000 07:55 15 /tmp/tcloop/mpg123.7/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f7a000-b7f7b000 r--p 00002000 07:55 15 /tmp/tcloop/mpg123.7/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f7b000-b7f7c000 r--p 00002000 07:55 15 /tmp/tcloop/mpg123.7/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
b7f7c000-b7f7d000 rw-p 00003000 07:55 15 /tmp/tcloop/mpg123.7/usr/local/lib/mpg123/output_alsa.so
Size: 4 kB
--
/tmp/tcloop/mpg123.8
08048000-08063000 rwxp 00000000 07:55 4 /tmp/tcloop/mpg123.8/usr/local/bin/mpg123
Size: 108 kB
--
b7f02000-b7f0f000 rwxp 00000000 07:55 13 /tmp/tcloop/mpg123.8/usr/local/lib/libout123.so.0.2.2
Size: 52 kB
--
b7f0f000-b7f63000 rwxp 00000000 07:55 9 /tmp/tcloop/mpg123.8/usr/local/lib/libmpg123.so.0.44.10
Size: 336 kB
--
b7f7a000-b7f7c000 rwxp 00000000 07:55 15 /tmp/tcloop/mpg123.8/usr/local/lib/mpg123/output_alsa.so
Size: 8 kB
--- End code ---
As You can see memory footprint of the executable itself (mpg123) with accompanied libs (libmpg123, liboutmpg123, output_alsa) is decreased by about 10% if linked with .xbn in one memory segment.
One thing is clear enough - using of .xbn linker script shrinks executables, decreases memory footprint and don't impact compile time and program performance. But resulting code is placed in the same meory segment with 'rwxp' flags, instead of using different segments with appropriate 'r--p' 'rw-p' or 'r-xp' flags. Maybe this is less secure way.
Regards!
Navigation
[0] Message Index
[*] Previous page
Go to full version