public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@bitrange.com>
To: <binutils@sources.redhat.com>
Subject: Committed, MMIX: gas: check the weakness of a symbol when relaxing
Date: Thu, 14 Mar 2002 02:06:00 -0000	[thread overview]
Message-ID: <Pine.BSF.4.30.0203140501170.47335-100000@dair.pair.com> (raw)

Doh!

gas:
	* config/tc-mmix.c (md_estimate_size_before_relax): Don't consider
	a weak symbol in same section to be within reach.

gas/testsuite:
	* gas/mmix/weak1.d, gas/mmix/weak1.d: New test.

Index: tc-mmix.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mmix.c,v
retrieving revision 1.5
diff -p -c -r1.5 tc-mmix.c
*** tc-mmix.c	2002/02/04 04:03:15	1.5
--- tc-mmix.c	2002/03/14 09:53:39
*************** md_estimate_size_before_relax (fragP, se
*** 2172,2178 ****
  #define HANDLE_RELAXABLE(state)						\
   case ENCODE_RELAX (state, STATE_UNDF):					\
     if (fragP->fr_symbol != NULL						\
!        && S_GET_SEGMENT (fragP->fr_symbol) == segment)			\
       {									\
         /* The symbol lies in the same segment - a relaxable case.  */	\
         fragP->fr_subtype						\
--- 2172,2179 ----
  #define HANDLE_RELAXABLE(state)						\
   case ENCODE_RELAX (state, STATE_UNDF):					\
     if (fragP->fr_symbol != NULL						\
!        && S_GET_SEGMENT (fragP->fr_symbol) == segment			\
!        && !S_IS_WEAK (fragP->fr_symbol))				\
       {									\
         /* The symbol lies in the same segment - a relaxable case.  */	\
         fragP->fr_subtype						\

*** /dev/null	Tue Jan  1 05:00:00 1980
--- weak1.s	Thu Mar 14 10:50:40 2002
***************
*** 0 ****
--- 1,7 ----
+ 	.weak foo
+ foo:
+ 	POP 1,0
+ 	.global main
+ main:
+ 	PUSHJ $15,foo
+ 	.quad foo
*** /dev/null	Tue Jan  1 05:00:00 1980
--- weak1.d	Thu Mar 14 10:48:51 2002
***************
*** 0 ****
--- 1,23 ----
+ #as: -x
+ #objdump: -str
+
+ # Relaxation thought a weak symbol was within reach.
+
+ .*:     file format elf64-mmix
+
+ SYMBOL TABLE:
+ 0+ l    d  \.text	0+
+ 0+ l    d  \.data	0+
+ 0+ l    d  \.bss	0+
+ 0+  w      \.text	0+ foo
+ 0+4 g       \.text	0+ main
+
+ RELOCATION RECORDS FOR \[\.text\]:
+ OFFSET           TYPE              VALUE
+ 0+18 R_MMIX_64         foo
+ 0+4 R_MMIX_PUSHJ      foo
+
+ Contents of section \.text:
+  0000 f8010000 f20f0000 fd000000 fd000000  .*
+  0010 fd000000 fd000000 00000000 00000000  .*
+ Contents of section \.data:

brgds, H-P

             reply	other threads:[~2002-03-14 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-14  2:06 Hans-Peter Nilsson [this message]
2002-03-17 14:51 ` 2.12: " Hans-Peter Nilsson

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=Pine.BSF.4.30.0203140501170.47335-100000@dair.pair.com \
    --to=hp@bitrange.com \
    --cc=binutils@sources.redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).