🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42085

how to put all consts into data segment?

#42085
From: Michael Hohmuth
Date: Mon, 22 Jan 1996 00:00
21 lines
1330 bytes
Is it possible to instruct GCC to put all initialized data into the
data segment, even constant data?

Would "-Dconst= -fwritable-strings" be sufficient?

The background is that I want to create a module which is to be linked
into an operating system which has its code segment register pointing
to a different value than the data segment register (i486 in 32 bit
mode).  I've instructed the linker to relocate the module's data/bss
segments to the correct address (even though they're physically in
subsequent real memory regions) in order to avoid any data address
dereferences to text segment addresses, but I understand that GCC
still puts constants into the the program's text segment.

Any advice appreciated!

Thanks in advance,
Michael
-- 
Email: hohmuth@inf.tu-dresden.de
WWW:   http://www.inf.tu-dresden.de/~mh1/
Technical Details
Message-ID: <a5u41o6umn.fsf@gozo.gmd.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,393f5e6a02d548f4,start
X-Google-Attributes: gid11318c,public
From: hohmuth@gozo.gmd.de (Michael Hohmuth)
Subject: how to put all consts into data segment?
Date: 1996/01/22
Message-ID: <a5u41o6umn.fsf@gozo.gmd.de>
X-Deja-AN: 136066987
sender: hohmuth@gozo.gmd.de
content-type: text/plain
organization: GMD, Birlinghoven, Germany
mime-version: 1.0
reply-to: hohmuth@inf.tu-dresden.de
newsgroups: gnu.gcc.help