Colin, thank you so much for helping me on this problem. Using the -M flag and
generate the map file
helped me identify where the problem is. I used EXTRA_SRCVPATH in my common.mk file
to add additional source for building the library. This will cause the compiler to
pick all the
source from that directory. However, I only need two files out of that path. When
using the
conventional makefile, it was specified what the source and object file to build.
That’s the
difference between these to library files.
My questions is how to specify the extra source files to build. I tried SRCS with a
list of
source files like the following:
SRCS = ./*.c $(PROJECT_ROOT)/…/2.2/clic.c
This doesn’t seem to work. It didn’t pick the clic.c and compile.
Very much appreciate your help.
The last thing I would like to see is the mapfile. COuld you add -M to the
link stage of both?
Thanks,
Colin
Beth <> id@address.com> > wrote:
Here is what I did.
- Changed dll directory to so directory, link with -Bsymbol. The library size
didn’t change.
- Took obj files from build that used conventional makefile, and link used QNX
makefile,
the library file size was still large.
/usr/bin/qcc -Vgcc_ntox86 -shared -Wl,-hlibfs.so.1
-Wl,–version-script=/devewc/src/nto/clic/
pto.qnx -o/devewc/src/nto/clic/x86/so/libfs.so dllentry.o
dllist.o selftest.o sha1_st.o statemachine.o -L. -L/x86/lib
-L/x86/usr/lib
/usr/bin/usemsg -s __USAGENTO -s __USAGE /devewc/src/nto/clic/x86/so/libfs.so
…/…/
libfs.use /bin/true /devewc/src/nto/clic/x86/so/libfs.so
- Took obj files from the build that used QNX makefile, and linked using
following line, the
library size is much small.
qcc -V gcc_ntox86 -DNTO_X86 -shared -Wl,–version-script=pto.qnx -Wl,-h
libfs.so
dllentry.o dllist.o selftest.o sha1_st.o statemachine.o -o …/lib/libfs.so
It appeared that the " link " did something different.
-Beth
Colin Burgess wrote:
Well, the rodata and text sections are much bigger, but I’m not sure how
the link could be causing that.
It could also be something different about the compile. I would try
using the objects from the QNX makefile build with the original link
command, see if it is still large.
Beth <> id@address.com> > wrote:
Colin, thanks for your help.
I will try to build it in the so directory. Here are two objdump -h from
both libs.
Large size lib output
libfs.so: file format elf32-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .hash 00000230 000000b4 000000b4 000000b4 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .dynsym 00000470 000002e4 000002e4 000002e4 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .dynstr 00000d98 00000754 00000754 00000754 20
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .gnu.version 0000008e 000014ec 000014ec 000014ec 21
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .gnu.version_d 00000038 0000157c 0000157c 0000157c 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .rel.data 00000178 000015b4 000015b4 000015b4 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .rel.ctors 00000008 0000172c 0000172c 0000172c 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .rel.dtors 00000008 00001734 00001734 00001734 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .rel.got 00000128 0000173c 0000173c 0000173c 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .rel.plt 00000088 00001864 00001864 00001864 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
10 .init 00000008 000018ec 000018ec 000018ec 20
CONTENTS, ALLOC, LOAD, READONLY, CODE
11 .plt 00000120 000018f4 000018f4 000018f4 22
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .text 00010d98 00001a14 00001a14 00001a14 22
CONTENTS, ALLOC, LOAD, READONLY, CODE
13 .fini 00000008 000127ac 000127ac 000127ac 20
CONTENTS, ALLOC, LOAD, READONLY, CODE
14 .rodata 00003ab1 000127c0 000127c0 000127c0 25
CONTENTS, ALLOC, LOAD, READONLY, DATA
15 .note0 00000000 00016271 00016271 00016271 20
CONTENTS, ALLOC, LOAD, READONLY, DATA
16 .data 00000a74 00017280 00017280 00016280 25
CONTENTS, ALLOC, LOAD, DATA
17 .ctors 0000000c 00017cf4 00017cf4 00016cf4 22
CONTENTS, ALLOC, LOAD, DATA
18 .dtors 0000000c 00017d00 00017d00 00016d00 22
CONTENTS, ALLOC, LOAD, DATA
19 .got 000000e4 00017d0c 00017d0c 00016d0c 22
CONTENTS, ALLOC, LOAD, DATA
20 .dynamic 000000a8 00017df0 00017df0 00016df0 22
CONTENTS, ALLOC, LOAD, DATA
21 .bss 000f4288 00017ea0 00017ea0 00016ea0 25
ALLOC
22 .comment 000002ac 00000000 00000000 00016ee8 20
CONTENTS, READONLY
23 .note 0000004c 00000000 00000000 00016e98 20
CONTENTS, READONLY
24 QNX_usage 000001d3 00000000 00000000 0001ac16 2**0
CONTENTS, READONLY
Small size output
libfs.so: file format elf32-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .hash 00000294 000000b4 000000b4 000000b4 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .dynsym 00000600 00000348 00000348 00000348 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .dynstr 0000056d 00000948 00000948 00000948 20
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .gnu.version 000000c0 00000eb6 00000eb6 00000eb6 21
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .gnu.version_d 00000038 00000f78 00000f78 00000f78 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .rel.data 00000010 00000fb0 00000fb0 00000fb0 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .rel.ctors 00000008 00000fc0 00000fc0 00000fc0 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .rel.dtors 00000008 00000fc8 00000fc8 00000fc8 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .rel.got 00000028 00000fd0 00000fd0 00000fd0 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .rel.plt 00000180 00000ff8 00000ff8 00000ff8 22
CONTENTS, ALLOC, LOAD, READONLY, DATA
10 .init 00000008 00001178 00001178 00001178 20
CONTENTS, ALLOC, LOAD, READONLY, CODE
11 .plt 00000310 00001180 00001180 00001180 22
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .text 00006ce8 00001490 00001490 00001490 22
CONTENTS, ALLOC, LOAD, READONLY, CODE
13 .fini 00000008 00008178 00008178 00008178 20
CONTENTS, ALLOC, LOAD, READONLY, CODE
14 .rodata 00000003 00008180 00008180 00008180 20
CONTENTS, ALLOC, LOAD, READONLY, DATA
15 .note0 00000000 00008183 00008183 00008183 20
CONTENTS, ALLOC, LOAD, READONLY, DATA
16 .data 00000914 000091a0 000091a0 000081a0 25
CONTENTS, ALLOC, LOAD, DATA
17 .ctors 0000000c 00009ab4 00009ab4 00008ab4 22
CONTENTS, ALLOC, LOAD, DATA
18 .dtors 0000000c 00009ac0 00009ac0 00008ac0 22
CONTENTS, ALLOC, LOAD, DATA
19 .got 000000e0 00009acc 00009acc 00008acc 22
CONTENTS, ALLOC, LOAD, DATA
20 .dynamic 000000a0 00009bac 00009bac 00008bac 22
CONTENTS, ALLOC, LOAD, DATA
21 .bss 000f4288 00009c60 00009c60 00008c60 25
ALLOC
22 .comment 00000260 00000000 00000000 00008c60 20
CONTENTS, READONLY
23 .note 00000140 00000000 00000000 00008ec0 20
CONTENTS, READONLY
Regards,
-Beth
Colin Burgess wrote:
Beth <> id@address.com> > wrote:
It might affect the lib size. How do I not to link with -Bsymbolic.
Build it in a nto/x86/so rather than nto/x86/dll directory.
Could you also post the results of objdump -h for both libs?
–
cburgess@qnx.com
–
cburgess@qnx.com
–
cburgess@qnx.com