comparison lwlink/link.c @ 262:7de7b14ebaee

Add support for os9 module edition byte Add support for the symbol "edition" in the __os9 section which defines the module edition byte which follows immedately after the module name in the module. It defaults to not setting one.
author William Astle <lost@l-w.ca>
date Mon, 04 Feb 2013 21:03:59 -0700
parents ebda5c96665e
children 8dd8c3bdca7c
comparison
equal deleted inserted replaced
261:f45b2a68c3da 262:7de7b14ebaee
724 int typeseen; 724 int typeseen;
725 int attrseen; 725 int attrseen;
726 int langseen; 726 int langseen;
727 int revseen; 727 int revseen;
728 int nameseen; 728 int nameseen;
729 int edseen;
729 }; 730 };
730 731
731 void check_os9_aux(section_t *s, void *arg) 732 void check_os9_aux(section_t *s, void *arg)
732 { 733 {
733 struct check_os9_aux_s *st = arg; 734 struct check_os9_aux_s *st = arg;
737 // several symbols may be defined as LOCAL symbols: 738 // several symbols may be defined as LOCAL symbols:
738 // type: module type 739 // type: module type
739 // lang: module language 740 // lang: module language
740 // attr: module attributes 741 // attr: module attributes
741 // rev: module revision 742 // rev: module revision
743 // ed: module edition
742 // 744 //
743 // the symbols are not case sensitive 745 // the symbols are not case sensitive
744 // 746 //
745 // any unrecognized symbols are ignored 747 // any unrecognized symbols are ignored
746 748
777 } 779 }
778 else if (!strcasecmp(sm, "stack")) 780 else if (!strcasecmp(sm, "stack"))
779 { 781 {
780 linkscript.stacksize += sym -> offset; 782 linkscript.stacksize += sym -> offset;
781 } 783 }
784 else if (!strcasecmp(sm, 'edition'))
785 {
786 linkscript.edition = sym -> offset;
787 st -> edseen++;
788 }
782 } 789 }
783 } 790 }
784 791
785 void check_os9(void) 792 void check_os9(void)
786 { 793 {
799 linkscript.modrev &= 15; 806 linkscript.modrev &= 15;
800 linkscript.modattr &= 15; 807 linkscript.modattr &= 15;
801 808
802 if (st.attrseen > 1 || st.typeseen > 1 || 809 if (st.attrseen > 1 || st.typeseen > 1 ||
803 st.langseen > 1 || st.revseen > 1 || 810 st.langseen > 1 || st.revseen > 1 ||
804 st.nameseen > 1 811 st.nameseen > 1 | st.edseen > 1
805 ) 812 )
806 { 813 {
807 fprintf(stderr, "Warning: multiple instances of __os9 found with duplicate settings of type, lang, attr, rev, or module name.\n"); 814 fprintf(stderr, "Warning: multiple instances of __os9 found with duplicate settings of type, lang, attr, rev, edition, or module name.\n");
808 } 815 }
809 } 816 }
810 817
811 void resolve_padding(void) 818 void resolve_padding(void)
812 { 819 {