/* obj-evax.c - EVAX (openVMS/Alpha) object file format.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2016 Free Software Foundation, Inc.
Contributed by Klaus Kämpf (kkaempf@progis.de) of
proGIS Software, Aachen, Germany.
Extensively enhanced by Douglas Rupp of AdaCore.
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
S_SET_WEAK (symbolP);
if (c == ',')
{
struct evax_private_udata_struct *udata;
- udata = (struct evax_private_udata_struct *)
- xmalloc (sizeof (struct evax_private_udata_struct));
+ udata = XNEW (struct evax_private_udata_struct);
udata->bsym = symbol_get_bfdsym (sym);
udata->enbsym = NULL;
}
/* We only need worry about krunching the base symbol. */
- base_id = xmalloc (suffix_dotdot - prefix_dotdot + 1);
- strncpy (base_id, &id[prefix_dotdot], suffix_dotdot - prefix_dotdot);
- base_id [suffix_dotdot - prefix_dotdot] = 0;
+ base_id = xmemdup0 (&id[prefix_dotdot], suffix_dotdot - prefix_dotdot);
if (strlen (base_id) > MAX_LABEL_LENGTH)
{
strcat (new_id, suffix);
/* Save it on the heap and return. */
- return_id = xmalloc (strlen (new_id) + 1);
- strcpy (return_id, new_id);
+ return_id = xstrdup (new_id);
return return_id;
}
which further designates that the name was truncated):
"original_identifier"_haaaaabbbccc
-
+
aaaaa = 32-bit CRC
bbb = length of original identifier
ccc = sum of 32-bit CRC characters
/* Table used by the crc32 function to calcuate the checksum. */
static unsigned int crc32_table[256] = {0, 0};
-/* Given a string in BUF, calculate a 32-bit CRC for it.
+/* Given a string in BUF, calculate a 32-bit CRC for it.
This is used as a reasonably unique hash for the given string. */
a truncated identifier. */
if (len != MAX_LABEL_LENGTH)
return 0;
-
+
/* Start scanning backwards for a _h. */
len = len - 3 - 3 - 5 - 2;
ptr = id + len;