[Bug middle-end/15486] [3.3/3.4/3.5] -fdata-sections moves common vars to .bss

jifl-bugzilla at jifvik dot org gcc-bugzilla@gcc.gnu.org
Tue Jun 22 11:12:00 GMT 2004


------- Additional Comments From jifl-bugzilla at jifvik dot org  2004-06-22 11:12 -------
Firstly the compiler has arguably not done as asked, because -fdata-sections did
not used to affect the bss section at all. That makes this a regression. As I
suggested, perhaps this should be a separate -fbss-sections option.

Secondly, what you are suggesting is deliberately breaking traditional unix
code, including moderately recent BSD kernels, as that's where the eCos code
came from (specifically TCP/IP). Sometimes such a thing could be justified if an
optimisation cannot be achieved any other way, but that is not true here: a
separate -fbss-sections option or similar (-fdata-sections -fno-bss-sections if
you want to retain this behaviour for -fdata-sections) could do this.

Finally, this is not quite the same as saying -fdata-sections implies
-fno-common. -fno-common is used to, essentially, put BSS data in the .data
section. That is not what -fdata-sections is now doing, although it is what one
would expect it to do if you did pass -fno-common (if you see the distinction I
mean). So it would be incorrect to document that -fdata-sections implies
-fno-common.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15486



More information about the Gcc-bugs mailing list