From 0ddab2890d12bac73a195c3d8770bf0c0e16329a Mon Sep 17 00:00:00 2001 From: hubicka Date: Wed, 28 Nov 2001 09:47:25 +0000 Subject: * cse.c (true_dependence_in_rtx): New function. (invalidate): Use it. * c-common.h (GOTO_FAKE_P): New macro. * tree-inline.c (GOTO_FAKE_P): Set. * c-tree.texi (GOTO_FAKE_P): Document. * varasm.c (assemble_variable): Set reloc to 3 for error_mark containing pointers. (output_addressed_constants): Check for local/external relocations. * elfos.h (SELECT_SECTION): Classify data section. * tm.texi (SELECT_SECTION): Update documentation. * cfganal.c (flow_dfs_compute_reverse_add_bb): set visited bit. (flow_dfs_compute_reverse_execute): Add only unvisited blocks. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47405 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/elfos.h | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'gcc/config/elfos.h') diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h index a5c7a710e31..503e141d778 100644 --- a/gcc/config/elfos.h +++ b/gcc/config/elfos.h @@ -352,7 +352,23 @@ const_section () \ /* A C statement or statements to switch to the appropriate section for output of DECL. DECL is either a `VAR_DECL' node or a constant of some sort. RELOC indicates whether forming - the initial value of DECL requires link-time relocations. */ + the initial value of DECL requires link-time relocations. + + To optimize loading of shared programs, define following subsections + of data section by attaching: + + .rel + Section with this string in name contains data that do have + relocations, so they get grouped together and dynamic linker + will visit fewer pages in memory. + .ro + Marks data read only otherwise. This is usefull with prelinking + as most of relocations won't be dynamically linked and thus + stay read only. + .local + Marks data containing relocations only to local objects. These + relocation will get fully resolved by prelinking. + */ #undef SELECT_SECTION #define SELECT_SECTION(DECL, RELOC, ALIGN) \ @@ -366,12 +382,22 @@ const_section () \ } \ else if (TREE_CODE (DECL) == VAR_DECL) \ { \ - if ((flag_pic && RELOC) \ - || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ + if (!TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ || !DECL_INITIAL (DECL) \ || (DECL_INITIAL (DECL) != error_mark_node \ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ - data_section (); \ + { \ + if (flag_pic && ((RELOC) & 2)) \ + named_section (NULL_TREE, ".data.rel", RELOC); \ + else if (flag_pic && (RELOC)) \ + named_section (NULL_TREE, ".data.rel.local", RELOC);\ + else \ + data_section (); \ + } \ + else if (flag_pic && ((RELOC) & 2)) \ + named_section (NULL_TREE, ".data.rel.ro", RELOC); \ + else if (flag_pic && (RELOC)) \ + named_section (NULL_TREE, ".data.rel.ro.local", RELOC); \ else if (flag_merge_constants < 2) \ /* C and C++ don't allow different variables to share \ the same location. -fmerge-all-constants allows \ -- cgit v1.2.1