Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
387 views
in Technique[技术] by (71.8m points)

c++ - Why is my code size so big without implementation?

Recently, I'm starting to develop a project on Microblaze using C++.

I just created the project and added nothing but a few library headers. The libraries include only the declaration of the classes. Just one of them is implemented and it is not even that big.
The rest of them doesn't even have neither implementation nor instantiated objects; just some members and an empty constructor. Even in that situation, the text section of the code is 8224 bytes and the data section is 1348 bytes.

As I have to debug the project, there is no active optimization in the compiler settings. What do you think that I'm doing wrong?

UPDATE:

I tried to remove the class with implementation from the sources. Now, the text size is 1948 bytes and the data size is 308 bytes. If I just don't include it's header, the size of the code doesn't change. I really don't know what's happening

UPDATE As @Gismo suggested, I tried to use mb-strip to utility to remove debug information from the code. But, couldn't achieve decreasing the code size. The output of the strip says something about supported targets, and I'm pretty sure that my platform is one of them.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...