[PATCH] D144190: [AIX][clang] Storage Locations for Constant Pointers

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 7 22:00:54 PST 2023


hubert.reinterpretcast added inline comments.


================
Comment at: clang/docs/ReleaseNotes.rst:229-231
+- Introduced the ``-mroptr`` option to place constant objects with relocatable
+  address values in the ready-only data section. This option is intended to
+  be used with the ``-fdata-sections`` option.
----------------
Should also mention the link-time behaviour that causes the read-only data sections with relocatable address values that resolve to imported symbols to be made writable.


================
Comment at: clang/docs/ReleaseNotes.rst:230
+- Introduced the ``-mroptr`` option to place constant objects with relocatable
+  address values in the ready-only data section. This option is intended to
+  be used with the ``-fdata-sections`` option.
----------------
Typo fix.


================
Comment at: clang/include/clang/Driver/Options.td:3896
+def mroptr : Flag<["-"], "mroptr">, Group<m_Group>, Flags<[CC1Option]>,
+  HelpText<"Place constant objects with relocatable address values in the RO data section">;
+def mno_roptr : Flag<["-"], "mno-roptr">, Group<m_Group>;
----------------
Also: "Implies -bforceimprw when specified at link time."


================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:127
+  // The `-mroptr` option places constants in RO sections as much as possible.
+  // Then `-bforceimprw` changes such sections to RW if they contain import
+  // symbols that needs to be resolved.
----------------
Minor nit: grammar


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144190/new/

https://reviews.llvm.org/D144190



More information about the cfe-commits mailing list