This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Patch to gas/write.c to let target check limits of an adjusted broken .word
- To: binutils at sourceware dot cygnus dot com
- Subject: Patch to gas/write.c to let target check limits of an adjusted broken .word
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Date: Sat, 11 Mar 2000 00:33:36 +0100
I'd like to make sure that gas can emit an error instead of
generating wrong code. I have a (what I believe is a)
not-too-contorted test-case that shows that to_addr overflows
and the error-check in the CRIS port definition of
TC_CHECK_ADJUSTED_BROKEN_DOT_WORD trigs.
If this is ok (perhaps with a name change), I'll document it in
internals.texi. Promise! :-)
Sat Mar 11 00:01:39 2000 Hans-Peter Nilsson <hp@axis.se>
* write.c (write_object_file) [! WORKING_DOT_WORD]: If defined,
call TC_CHECK_ADJUSTED_BROKEN_DOT_WORD for each word after
adjustments.
Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.11
diff -c -p -r1.11 write.c
*** write.c 1999/09/12 03:44:41 1.11
--- write.c 2000/03/10 22:09:43
*************** write_object_file ()
*** 1629,1634 ****
--- 1629,1637 ----
#ifdef BFD_ASSEMBLER
to_addr -= symbol_get_frag (lie->sub)->fr_address;
#endif
+ #ifdef TC_CHECK_ADJUSTED_BROKEN_DOT_WORD
+ TC_CHECK_ADJUSTED_BROKEN_DOT_WORD (to_addr, lie);
+ #endif
md_number_to_chars (lie->word_goes_here, to_addr, 2);
for (untruth = lie->next_broken_word; untruth && untruth->dispfrag == fragP; untruth = untruth->next_broken_word)
{
brgds, H-P