lwIP - A Lightweight TCP/IP stack - Bugs: bug #20254, Initializing static/global...
You are not allowed to post comments on this tracker with your current authentication level.
bug #20254: Initializing static/global variables
Submitter: | Petr Cernin <cerninp> | ||
Submitted: | Mon 25 Jun 2007 03:55:57 PM UTC | ||
Category: | sockets/netconn | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Invalid |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | None |
Jump to the original submission
Tue 26 Jun 2007 03:12:10 PM UTC, comment #8: |
Simon Goldschmidt <goldsimon> |
Tue 26 Jun 2007 09:23:51 AM UTC, comment #7: Julian Gardner wrote:
|
Simon Goldschmidt <goldsimon> |
Tue 26 Jun 2007 08:53:33 AM UTC, comment #6: As far as I know (at least for gcc), initialized variables go into the data or sdata section, which is present in the binary (initialized values are 'on the disk'). In contrast, uninitialized variables (whether static or not) go into the sbss section, which doesn't need to be located in the binary. There only has to be information about how big that region is and the loader (in my embedded case, a self-made init-code written in assembly) zeros this region on booting.
|
Simon Goldschmidt <goldsimon> |
Tue 26 Jun 2007 07:37:50 AM UTC, comment #5: I agree that the primary problem is on my side - my compiler/linker/startup code seems to be broken.
|
Petr Cernin <cerninp> |
Mon 25 Jun 2007 05:57:06 PM UTC, comment #4: I'm fairly certain the binary would retain the same size, as space for data has to come from somewhere. Perhaps some OSes support some mechanism to initialize a special data section at process load. If someone could show how they could use this mechanism, it would be worthwhile. |
Thomas Taranowski <taranowski> |
Mon 25 Jun 2007 05:35:25 PM UTC, comment #3: I don't like the idea of creating ifdefs for that initialization, it makes the code look ugly! It only could reduce the size of the binary if data wasn't save in the binary as initialized (or am I wrong there?) |
Simon Goldschmidt <goldsimon> |
Mon 25 Jun 2007 04:38:27 PM UTC, comment #2: This sounds like it's potentially an issue with the linker script, or some other problem. The compiler should support initialization of statics if it
|
Thomas Taranowski <taranowski> |
Mon 25 Jun 2007 04:05:50 PM UTC, comment #1: Could you also file a bug with the compiler writers?
|
Kieran Mansley <kieranm> |
Mon 25 Jun 2007 03:55:57 PM UTC, original submission:
Hello guys,
|
Petr Cernin <cerninp> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 2 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-06-26 | goldsimon | Status | None | Invalid | |
Open/Closed | Open | Closed |
Powered by Savane 3.13-d3ae.
Corresponding source code
OK, we all agree this certainly is not a bug in lwIP, so I'm closing it as invalid.
On the other hand, we should have a conversation about how we initialize global (static or not) variables.