Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1064)

Side by Side Diff: third_party/yasm/patched-yasm/modules/objfmts/rdf/rdf-objfmt.c

Issue 6170009: Update our yasm copy to yasm 1.1.0 (Part 1: yasm side)... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Relocatable Dynamic Object File Format (RDOFF) version 2 format 2 * Relocatable Dynamic Object File Format (RDOFF) version 2 format
3 * 3 *
4 * Copyright (C) 2006-2007 Peter Johnson 4 * Copyright (C) 2006-2007 Peter Johnson
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE. 25 * POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 #include <util.h> 27 #include <util.h>
28 /*@unused@*/ RCSID("$Id: rdf-objfmt.c 2166 2009-01-02 08:33:21Z peter $"); 28 /*@unused@*/ RCSID("$Id: rdf-objfmt.c 2310 2010-03-28 19:28:54Z peter $");
29 29
30 #include <libyasm.h> 30 #include <libyasm.h>
31 31
32 32
33 #define REGULAR_OUTBUF_SIZE 1024 33 #define REGULAR_OUTBUF_SIZE 1024
34 34
35 #define RDF_MAGIC "RDOFF2" 35 #define RDF_MAGIC "RDOFF2"
36 36
37 /* Maximum size of an import/export label (including trailing zero) */ 37 /* Maximum size of an import/export label (including trailing zero) */
38 #define EXIM_LABEL_MAX 64 38 #define EXIM_LABEL_MAX 64
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 while (cur) { 804 while (cur) {
805 next = STAILQ_NEXT(cur, link); 805 next = STAILQ_NEXT(cur, link);
806 yasm_xfree(cur->str); 806 yasm_xfree(cur->str);
807 yasm_xfree(cur); 807 yasm_xfree(cur);
808 cur = next; 808 cur = next;
809 } 809 }
810 810
811 yasm_xfree(objfmt); 811 yasm_xfree(objfmt);
812 } 812 }
813 813
814 static rdf_section_data * 814 static void
815 rdf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, 815 rdf_objfmt_init_new_section(yasm_section *sect, unsigned long line)
816 const char *sectname, unsigned long line)
817 { 816 {
817 yasm_object *object = yasm_section_get_object(sect);
818 const char *sectname = yasm_section_get_name(sect);
818 yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)object->objfmt; 819 yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)object->objfmt;
819 rdf_section_data *data; 820 rdf_section_data *data;
820 yasm_symrec *sym; 821 yasm_symrec *sym;
821 822
822 data = yasm_xmalloc(sizeof(rdf_section_data)); 823 data = yasm_xmalloc(sizeof(rdf_section_data));
823 data->scnum = objfmt_rdf->parse_scnum++; 824 data->scnum = objfmt_rdf->parse_scnum++;
824 data->type = 0; 825 data->type = 0;
825 data->reserved = 0; 826 data->reserved = 0;
826 data->size = 0; 827 data->size = 0;
827 data->raw_data = NULL; 828 data->raw_data = NULL;
828 yasm_section_add_data(sect, &rdf_section_data_cb, data); 829 yasm_section_add_data(sect, &rdf_section_data_cb, data);
829 830
830 sym = yasm_symtab_define_label(object->symtab, sectname, 831 sym = yasm_symtab_define_label(object->symtab, sectname,
831 yasm_section_bcs_first(sect), 1, line); 832 yasm_section_bcs_first(sect), 1, line);
832 data->sym = sym; 833 data->sym = sym;
833 return data;
834 } 834 }
835 835
836 static yasm_section * 836 static yasm_section *
837 rdf_objfmt_add_default_section(yasm_object *object) 837 rdf_objfmt_add_default_section(yasm_object *object)
838 { 838 {
839 yasm_section *retval; 839 yasm_section *retval;
840 rdf_section_data *rsd; 840 rdf_section_data *rsd;
841 int isnew; 841 int isnew;
842 842
843 retval = yasm_object_get_general(object, ".text", 0, 1, 0, &isnew, 0); 843 retval = yasm_object_get_general(object, ".text", 0, 1, 0, &isnew, 0);
844 if (isnew) { 844 if (isnew) {
845 rsd = rdf_objfmt_init_new_section(object, retval, ".text", 0); 845 rsd = yasm_section_get_data(retval, &rdf_section_data_cb);
846 rsd->type = RDF_SECT_CODE; 846 rsd->type = RDF_SECT_CODE;
847 rsd->reserved = 0; 847 rsd->reserved = 0;
848 yasm_section_set_default(retval, 1); 848 yasm_section_set_default(retval, 1);
849 } 849 }
850 return retval; 850 return retval;
851 } 851 }
852 852
853 static int 853 static int
854 rdf_helper_set_type(void *obj, yasm_valparam *vp, unsigned long line, 854 rdf_helper_set_type(void *obj, yasm_valparam *vp, unsigned long line,
855 void *d, uintptr_t newtype) 855 void *d, uintptr_t newtype)
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 943 }
944 944
945 if (data.reserved_intn) { 945 if (data.reserved_intn) {
946 reserved = yasm_intnum_get_uint(data.reserved_intn); 946 reserved = yasm_intnum_get_uint(data.reserved_intn);
947 yasm_intnum_destroy(data.reserved_intn); 947 yasm_intnum_destroy(data.reserved_intn);
948 } 948 }
949 949
950 retval = yasm_object_get_general(object, sectname, 0, 1, 950 retval = yasm_object_get_general(object, sectname, 0, 1,
951 data.type == RDF_SECT_BSS, &isnew, line); 951 data.type == RDF_SECT_BSS, &isnew, line);
952 952
953 if (isnew) 953 rsd = yasm_section_get_data(retval, &rdf_section_data_cb);
954 rsd = rdf_objfmt_init_new_section(object, retval, sectname, line);
955 else
956 rsd = yasm_section_get_data(retval, &rdf_section_data_cb);
957 954
958 if (isnew || yasm_section_is_default(retval)) { 955 if (isnew || yasm_section_is_default(retval)) {
959 yasm_section_set_default(retval, 0); 956 yasm_section_set_default(retval, 0);
960 rsd->type = data.type; 957 rsd->type = data.type;
961 rsd->reserved = reserved; 958 rsd->reserved = reserved;
962 } else if (flags_override) 959 } else if (flags_override)
963 yasm_warn_set(YASM_WARN_GENERAL, 960 yasm_warn_set(YASM_WARN_GENERAL,
964 N_("section flags ignored on section redeclaration")); 961 N_("section flags ignored on section redeclaration"));
965 return retval; 962 return retval;
966 } 963 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 32, 1078 32,
1082 0, 1079 0,
1083 rdf_objfmt_dbgfmt_keywords, 1080 rdf_objfmt_dbgfmt_keywords,
1084 "null", 1081 "null",
1085 rdf_objfmt_directives, 1082 rdf_objfmt_directives,
1086 rdf_objfmt_stdmacs, 1083 rdf_objfmt_stdmacs,
1087 rdf_objfmt_create, 1084 rdf_objfmt_create,
1088 rdf_objfmt_output, 1085 rdf_objfmt_output,
1089 rdf_objfmt_destroy, 1086 rdf_objfmt_destroy,
1090 rdf_objfmt_add_default_section, 1087 rdf_objfmt_add_default_section,
1088 rdf_objfmt_init_new_section,
1091 rdf_objfmt_section_switch, 1089 rdf_objfmt_section_switch,
1092 rdf_objfmt_get_special_sym 1090 rdf_objfmt_get_special_sym
1093 }; 1091 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698