diff options
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/config/obj-elf.c | 18 |
2 files changed, 12 insertions, 13 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index d8d8908..fe13be3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2001-11-13 Alan Modra <amodra@bigpond.net.au> + + * config/obj-elf.c (obj_elf_version): Ensure terminating NUL is + put in note section. Use sizeof instead of hard-coded constants. + 2001-11-12 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> * config/tc-mips.c (support_64bit_objects): Define for OBJ_ELF only. @@ -50,7 +55,7 @@ * config/tc-avr.c (mcu_types): Update for new devices. -2001-11-02 Stephane Carrez <Stephane.Carrez@worldnet.fr> +2001-11-09 Stephane Carrez <Stephane.Carrez@worldnet.fr> * doc/Makefile.am (POD2MAN): Use 'GNU Development Tools' for the page man title. diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 7b6c5b2..3c4531e 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -1417,14 +1417,13 @@ obj_elf_version (ignore) { char *name; unsigned int c; - char ch; char *p; asection *seg = now_seg; subsegT subseg = now_subseg; Elf_Internal_Note i_note; Elf_External_Note e_note; asection *note_secp = (asection *) NULL; - int i, len; + int len; SKIP_WHITESPACE (); if (*input_line_pointer == '\"') @@ -1454,19 +1453,14 @@ obj_elf_version (ignore) i_note.descsz = 0; /* no description */ i_note.type = NT_VERSION; p = frag_more (sizeof (e_note.namesz)); - md_number_to_chars (p, (valueT) i_note.namesz, 4); + md_number_to_chars (p, (valueT) i_note.namesz, sizeof (e_note.namesz)); p = frag_more (sizeof (e_note.descsz)); - md_number_to_chars (p, (valueT) i_note.descsz, 4); + md_number_to_chars (p, (valueT) i_note.descsz, sizeof (e_note.descsz)); p = frag_more (sizeof (e_note.type)); - md_number_to_chars (p, (valueT) i_note.type, 4); + md_number_to_chars (p, (valueT) i_note.type, sizeof (e_note.type)); + p = frag_more (len + 1); + strcpy (p, name); - for (i = 0; i < len; i++) - { - ch = *(name + i); - { - FRAG_APPEND_1_CHAR (ch); - } - } frag_align (2, 0, 0); subseg_set (seg, subseg); |