aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-11-20 22:16:05 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-11-20 22:16:05 +0000
commitb039ef04574106adbac611394b008109967d2a73 (patch)
tree4a43b619abbc3c62b8d267a0797003717c5d77e9 /ld/emultempl
parentace21957447369d273622e8869f1183549cded3d (diff)
downloadgdb-b039ef04574106adbac611394b008109967d2a73.zip
gdb-b039ef04574106adbac611394b008109967d2a73.tar.gz
gdb-b039ef04574106adbac611394b008109967d2a73.tar.bz2
Implement ELF linker -z global option
ld/ * ld.texinfo: Document "-z global". * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Support "-z global". (gld${EMULATION_NAME}_list_options): Likewise. ld/testsuite/ * ld-elf/global1.d: New file.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf32.em5
1 files changed, 5 insertions, 0 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 9e263a9..acb01e5 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -2300,6 +2300,8 @@ fragment <<EOF
EOF
if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
fragment <<EOF
+ else if (strcmp (optarg, "global") == 0)
+ link_info.flags_1 |= (bfd_vma) DF_1_GLOBAL;
else if (strcmp (optarg, "initfirst") == 0)
link_info.flags_1 |= (bfd_vma) DF_1_INITFIRST;
else if (strcmp (optarg, "interpose") == 0)
@@ -2419,6 +2421,9 @@ EOF
if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
fragment <<EOF
fprintf (file, _("\
+ -z global Make symbols in DSO available for subsequently\n\
+ loaded objects\n"));
+ fprintf (file, _("\
-z initfirst Mark DSO to be initialized first at runtime\n"));
fprintf (file, _("\
-z interpose Mark object to interpose all DSOs but executable\n"));