3389 views|14 replies
woody_chen
Currently offline
|
The OP
Published on 2020-3-2 22:49
Only look at the author
This post is from Programming Basics
Latest reply | |
|
||
2
Published on 2020-3-3 09:52
Only look at the author
This post is from Programming Basics
| ||
|
||
|
3
Published on 2020-3-3 22:45
Only look at the author
This post is from Programming Basics
Comments
I copied it by example. The original BSS segment is like this. .bss : { . = (((. + 3) / 4)*4); PROVIDE(_start_bss_ = .); *(.sbss) *(.sbss.*) *(.bss) *(.bss.*) } PROVIDE(_e
Details
Published on 2020-3-4 10:03
| ||
Personal signature
默认摸鱼,再摸鱼。2022、9、28 |
||
|
woody_chen
Currently offline
|
This post is from Programming Basics
| |
|
||
|
5
Published on 2020-3-4 10:18
Only look at the author
This post is from Programming Basics
Comments
I wrote it like this. But the global variables in keyboard.o are allocated to the bss below. Only the static variables are in keyscan_bss.
Details
Published on 2020-3-4 12:39
| ||
Personal signature
默认摸鱼,再摸鱼。2022、9、28 |
||
|
woody_chen
Currently offline
|
This post is from Programming Basics
| |
|
||
|
7
Published on 2020-3-4 22:02
Only look at the author
This post is from Programming Basics
| ||
Personal signature
默认摸鱼,再摸鱼。2022、9、28 |
||
|
hotsauce1861
Currently offline
|
8
Published on 2020-3-4 22:13
Only look at the author
This post is from Programming Basics
Comments
This is a little more troublesome. You need to add this attribute before each variable.
Details
Published on 2020-3-6 10:00
| |
|
||
|
woody_chen
Currently offline
|
This post is from Programming Basics
| |
|
||
|
10
Published on 2020-4-10 17:49
Only look at the author
This post is from Programming Basics
Comments
Great! Thank you for your explanation. I will try it. 1. Static variables without static modifier belong to common section 2. Most link files will put common section in BSS section. Isn't this just taking off pants to fart, redundant?
Details
Published on 2020-4-13 10:42
| ||
|
||
|
woody_chen
Currently offline
|
This post is from Programming Basics
Comments
1: Global variables are just a type of static variables, but for the sake of convenience, "global variables" are used instead of "static variables". 2: Sorry, the description that "static variables without static modifier belong to the common section" is wrong.
Details
Published on 2020-4-13 21:45
| |
|
||
|
12
Published on 2020-4-13 21:45
Only look at the author
This post is from Programming Basics
Comments
I have tested it and it works. After adding -fno-common, duplicate defined variables will report an error. Without this option, no error will be reported.
Details
Published on 2020-4-14 11:21
| ||
|
||
|
13
Published on 2020-4-13 21:55
Only look at the author
This post is from Programming Basics
| ||
|
||
|
woody_chen
Currently offline
|
This post is from Programming Basics
| |
|
||
|
15
Published on 2023-11-4 16:18
Only look at the author
This post is from Programming Basics
| ||
|
||
|
EEWorld Datasheet Technical Support
EEWorld
subscription
account
EEWorld
service
account
Automotive
development
circle
About Us Customer Service Contact Information Datasheet Sitemap LatestNews
Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190