Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "H . J . Lu" <hjl@lucon.org>
To: binutils@sourceware.cygnus.com
Cc: linux-mips@oss.sgi.com
Subject: A patch for ELF section symbols
Date: Wed, 6 Jun 2001 14:20:05 -0700	[thread overview]
Message-ID: <20010606142005.A27310@lucon.org> (raw)

On mips, both _gp_disp and _DYNAMIC_LINKING/_DYNAMIC_LINK are
explicitly marked as glocal section symbols. We should keep them
during objcopy.


H.J.
----
2001-06-06  H.J. Lu  <hjl@gnu.org>

	* elf.c (swap_out_syms): Keep names for global section symbols.

--- binutils/bfd/elf.c.mips	Tue May 15 20:03:57 2001
+++ binutils/bfd/elf.c	Tue May 15 21:20:49 2001
@@ -4395,9 +4395,9 @@ swap_out_syms (abfd, sttp, relocatable_p
 	flagword flags = syms[idx]->flags;
 	int type;
 
-	if ((flags & BSF_SECTION_SYM) != 0)
+	if ((flags & (BSF_SECTION_SYM | BSF_GLOBAL)) == BSF_SECTION_SYM)
 	  {
-	    /* Section symbols have no name.  */
+	    /* Local section symbols have no name.  */
 	    sym.st_name = 0;
 	  }
 	else
@@ -4506,7 +4506,12 @@ swap_out_syms (abfd, sttp, relocatable_p
           type = (*bed->elf_backend_get_symbol_type) (&type_ptr->internal_elf_sym, type);
 
 	if (flags & BSF_SECTION_SYM)
-	  sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
+	  {
+	    if (flags & BSF_GLOBAL)
+	      sym.st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION);
+	    else
+	      sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
+	  }
 	else if (bfd_is_com_section (syms[idx]->section))
 	  sym.st_info = ELF_ST_INFO (STB_GLOBAL, type);
 	else if (bfd_is_und_section (syms[idx]->section))

                 reply	other threads:[~2001-06-06 21:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010606142005.A27310@lucon.org \
    --to=hjl@lucon.org \
    --cc=binutils@sourceware.cygnus.com \
    --cc=linux-mips@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox