From 5826770c628d6e527ac774243d3632ad44ed49ce Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 8 Sep 2004 11:56:22 -0700 Subject: [PATCH] darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add -segaddr, -segs_read_only_addr and -segs_read_write_addr. * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add -segaddr, -segs_read_only_addr and -segs_read_write_addr. (WORD_SWITCH_TAKES_ARG): Same. (LINK_SPEC): Same. * doc/invoke.texi: Document -segaddr, -segs_read_only_addr and -segs_read_write_addr. * gcc.dg/darwin-ld-20040828-1.c: New test. * gcc.dg/darwin-ld-20040828-2.c: New test. * gcc.dg/darwin-ld-20040828-3.c: New test. From-SVN: r87197 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/darwin.h | 15 +++++++++++++-- gcc/doc/invoke.texi | 7 +++++++ gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/darwin-ld-20040828-1.c | 13 +++++++++++++ gcc/testsuite/gcc.dg/darwin-ld-20040828-2.c | 13 +++++++++++++ gcc/testsuite/gcc.dg/darwin-ld-20040828-3.c | 13 +++++++++++++ 7 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/darwin-ld-20040828-1.c create mode 100644 gcc/testsuite/gcc.dg/darwin-ld-20040828-2.c create mode 100644 gcc/testsuite/gcc.dg/darwin-ld-20040828-3.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c58585af6e9..ce2df35771c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2004-09-08 Devang Patel + + * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add -segaddr, + -segs_read_only_addr and -segs_read_write_addr. + (WORD_SWITCH_TAKES_ARG): Same. + (LINK_SPEC): Same. + * doc/invoke.texi: Document -segaddr, -segs_read_only_addr and + -segs_read_write_addr. + + 2004-09-08 Richard Henderson * function.c (reference_callee_copied): New. diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 0099e0bbbd3..a89976e14e9 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -116,6 +116,10 @@ Boston, MA 02111-1307, USA. */ { "-dynamic", "-Zdynamic" }, \ { "-dynamiclib", "-Zdynamiclib" }, \ { "-exported_symbols_list", "-Zexported_symbols_list" }, \ + { "-segaddr", "-Zsegaddr" }, \ + { "-segs_read_only_addr", "-Zsegs_read_only_addr" }, \ + { "-segs_read_write_addr", "-Zsegs_read_write_addr" }, \ + { "-seg_addr_table", "-Zseg_addr_table" }, \ { "-seg_addr_table_filename", "-Zseg_addr_table_filename" }, \ { "-filelist", "-Xlinker -filelist -Xlinker" }, \ { "-framework", "-Xlinker -framework -Xlinker" }, \ @@ -174,10 +178,13 @@ extern const char *darwin_fix_and_continue_switch; !strcmp (STR, "read_only_relocs") ? 1 : \ !strcmp (STR, "sectcreate") ? 3 : \ !strcmp (STR, "sectorder") ? 3 : \ + !strcmp (STR, "Zsegaddr") ? 2 : \ + !strcmp (STR, "Zsegs_read_only_addr") ? 1 : \ + !strcmp (STR, "Zsegs_read_write_addr") ? 1 : \ + !strcmp (STR, "Zseg_addr_table") ? 1 : \ !strcmp (STR, "Zseg_addr_table_filename") ?1 :\ !strcmp (STR, "seg1addr") ? 1 : \ !strcmp (STR, "segprot") ? 3 : \ - !strcmp (STR, "seg_addr_table") ? 1 : \ !strcmp (STR, "sub_library") ? 1 : \ !strcmp (STR, "sub_umbrella") ? 1 : \ !strcmp (STR, "umbrella") ? 1 : \ @@ -275,7 +282,11 @@ extern const char *darwin_fix_and_continue_switch; %{Zmultiplydefinedunused*:-multiply_defined_unused %*} \ %{prebind} %{noprebind} %{nofixprebinding} %{prebind_all_twolevel_modules} \ %{read_only_relocs} \ - %{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} %{seg_addr_table*} \ + %{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} \ + %{Zsegaddr*:-segaddr %*} \ + %{Zsegs_read_only_addr*:-segs_read_only_addr %*} \ + %{Zsegs_read_write_addr*:-segs_read_write_addr %*} \ + %{Zseg_addr_table*: -seg_addr_table %*} \ %{Zseg_addr_table_filename*:-seg_addr_table_filename %*} \ %{sub_library*} %{sub_umbrella*} \ %{twolevel_namespace} %{twolevel_namespace_hints} \ diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index f1fdc306526..17b11540477 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -422,6 +422,7 @@ Objective-C and Objective-C++ Dialects}. -private_bundle -read_only_relocs -sectalign @gol -sectobjectsymbols -whyload -seg1addr @gol -sectcreate -sectobjectsymbols -sectorder @gol +-segaddr -segs_read_only_addr -segs_read_write_addr @gol -seg_addr_table -seg_addr_table_filename -seglinkedit @gol -segprot -segs_read_only_addr -segs_read_write_addr @gol -single_module -static -sub_library -sub_umbrella @gol @@ -7275,6 +7276,9 @@ output file being linked. See man ld(1) for more information. @itemx -sectcreate @itemx -sectobjectsymbols @itemx -sectorder +@itemx -segaddr +@itemx -segs_read_only_addr +@itemx -segs_read_write_addr @itemx -seg_addr_table @itemx -seg_addr_table_filename @itemx -seglinkedit @@ -7334,6 +7338,9 @@ output file being linked. See man ld(1) for more information. @opindex sectcreate @opindex sectobjectsymbols @opindex sectorder +@opindex segaddr +@opindex segs_read_only_addr +@opindex segs_read_write_addr @opindex seg_addr_table @opindex seg_addr_table_filename @opindex seglinkedit diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 05dfa724e99..23cd6ff72f9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2004-09-08 Devang Patel + + * gcc.dg/darwin-ld-20040828-1.c: New test. + * gcc.dg/darwin-ld-20040828-2.c: New test. + * gcc.dg/darwin-ld-20040828-3.c: New test. + 2004-09-08 Ziemowit Laski * objc.dg/bitfield-2.m: Make 'id' definition a typedef. diff --git a/gcc/testsuite/gcc.dg/darwin-ld-20040828-1.c b/gcc/testsuite/gcc.dg/darwin-ld-20040828-1.c new file mode 100644 index 00000000000..b90328be9de --- /dev/null +++ b/gcc/testsuite/gcc.dg/darwin-ld-20040828-1.c @@ -0,0 +1,13 @@ +/* Test -segaddr. */ +/* Contributed by Devang Patel */ + +/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-options "-segaddr __DATA 4000" } */ + + +int +main () +{ + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/darwin-ld-20040828-2.c b/gcc/testsuite/gcc.dg/darwin-ld-20040828-2.c new file mode 100644 index 00000000000..51f5ae83086 --- /dev/null +++ b/gcc/testsuite/gcc.dg/darwin-ld-20040828-2.c @@ -0,0 +1,13 @@ +/* Test -segs_read_only_addr. */ +/* Contributed by Devang Patel */ + +/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-options "-segs_read_only_addr 4000 -dynamiclib" } */ + + +int +main () +{ + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/darwin-ld-20040828-3.c b/gcc/testsuite/gcc.dg/darwin-ld-20040828-3.c new file mode 100644 index 00000000000..ca8928bd86a --- /dev/null +++ b/gcc/testsuite/gcc.dg/darwin-ld-20040828-3.c @@ -0,0 +1,13 @@ +/* Test -segs_read_write_addr. */ +/* Contributed by Devang Patel */ + +/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-options "-segs_read_only_addr 4000 -segs_read_write_addr 8000 -dynamiclib" } */ + + +int +main () +{ + return 0; +} + -- 2.30.2