You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
163 lines
5.0 KiB
163 lines
5.0 KiB
diff -rupN --no-dereference binutils-2.38/binutils/readelf.c binutils-2.38-new/binutils/readelf.c
|
|
--- binutils-2.38/binutils/readelf.c 2022-04-26 13:54:50.369529409 +0200
|
|
+++ binutils-2.38-new/binutils/readelf.c 2022-04-26 13:54:51.333530785 +0200
|
|
@@ -12991,11 +12991,13 @@ print_dynamic_symbol (Filedata *filedata
|
|
unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
|
|
|
|
printf (" %-7s", get_symbol_visibility (vis));
|
|
+#if 0
|
|
/* Check to see if any other bits in the st_other field are set.
|
|
Note - displaying this information disrupts the layout of the
|
|
table being generated, but for the moment this case is very rare. */
|
|
if (psym->st_other ^ vis)
|
|
printf (" [%s] ", get_symbol_other (filedata, psym->st_other ^ vis));
|
|
+#endif
|
|
}
|
|
printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx));
|
|
|
|
@@ -13049,7 +13051,17 @@ print_dynamic_symbol (Filedata *filedata
|
|
version_string);
|
|
}
|
|
|
|
- putchar ('\n');
|
|
+#if 1
|
|
+ {
|
|
+ unsigned int vis = ELF_ST_VISIBILITY (psym->st_other);
|
|
+
|
|
+ /* Check to see if any other bits in the st_other field are set. */
|
|
+ if (psym->st_other ^ vis)
|
|
+ printf (" \t[%s]", get_symbol_other (filedata, psym->st_other ^ vis));
|
|
+ }
|
|
+#endif
|
|
+
|
|
+ putchar ('\n');
|
|
|
|
if (ELF_ST_BIND (psym->st_info) == STB_LOCAL
|
|
&& section != NULL
|
|
diff -rupN --no-dereference binutils-2.38/binutils/readelf.c.orig binutils-2.38-new/binutils/readelf.c.orig
|
|
--- binutils-2.38/binutils/readelf.c.orig 2022-04-26 13:54:50.375529417 +0200
|
|
+++ binutils-2.38-new/binutils/readelf.c.orig 2022-04-26 13:54:49.332527928 +0200
|
|
@@ -22327,46 +22327,53 @@ process_file (char * file_name)
|
|
Filedata * filedata = NULL;
|
|
struct stat statbuf;
|
|
char armag[SARMAG];
|
|
- bool ret = true;
|
|
+ bool ret = false;
|
|
+ char * name;
|
|
+ char * saved_program_name;
|
|
+
|
|
+ /* Overload program_name to include file_name. Doing this means
|
|
+ that warning/error messages will positively identify the file
|
|
+ concerned even when multiple instances of readelf are running. */
|
|
+ name = xmalloc (strlen (program_name) + strlen (file_name) + 3);
|
|
+ sprintf (name, "%s: %s", program_name, file_name);
|
|
+ saved_program_name = program_name;
|
|
+ program_name = name;
|
|
|
|
if (stat (file_name, &statbuf) < 0)
|
|
{
|
|
if (errno == ENOENT)
|
|
- error (_("'%s': No such file\n"), file_name);
|
|
+ error (_("No such file\n"));
|
|
else
|
|
- error (_("Could not locate '%s'. System error message: %s\n"),
|
|
- file_name, strerror (errno));
|
|
- return false;
|
|
+ error (_("Could not locate file. System error message: %s\n"),
|
|
+ strerror (errno));
|
|
+ goto done;
|
|
}
|
|
|
|
if (! S_ISREG (statbuf.st_mode))
|
|
{
|
|
- error (_("'%s' is not an ordinary file\n"), file_name);
|
|
- return false;
|
|
+ error (_("Not an ordinary file\n"));
|
|
+ goto done;
|
|
}
|
|
|
|
filedata = calloc (1, sizeof * filedata);
|
|
if (filedata == NULL)
|
|
{
|
|
error (_("Out of memory allocating file data structure\n"));
|
|
- return false;
|
|
+ goto done;
|
|
}
|
|
|
|
filedata->file_name = file_name;
|
|
filedata->handle = fopen (file_name, "rb");
|
|
if (filedata->handle == NULL)
|
|
{
|
|
- error (_("Input file '%s' is not readable.\n"), file_name);
|
|
- free (filedata);
|
|
- return false;
|
|
+ error (_("Not readable\n"));
|
|
+ goto done;
|
|
}
|
|
|
|
if (fread (armag, SARMAG, 1, filedata->handle) != 1)
|
|
{
|
|
- error (_("%s: Failed to read file's magic number\n"), file_name);
|
|
- fclose (filedata->handle);
|
|
- free (filedata);
|
|
- return false;
|
|
+ error (_("Failed to read file's magic number\n"));
|
|
+ goto done;
|
|
}
|
|
|
|
filedata->file_size = (bfd_size_type) statbuf.st_size;
|
|
@@ -22374,33 +22381,39 @@ process_file (char * file_name)
|
|
|
|
if (memcmp (armag, ARMAG, SARMAG) == 0)
|
|
{
|
|
- if (! process_archive (filedata, false))
|
|
- ret = false;
|
|
+ if (process_archive (filedata, false))
|
|
+ ret = true;
|
|
}
|
|
else if (memcmp (armag, ARMAGT, SARMAG) == 0)
|
|
{
|
|
- if ( ! process_archive (filedata, true))
|
|
- ret = false;
|
|
+ if (process_archive (filedata, true))
|
|
+ ret = true;
|
|
}
|
|
else
|
|
{
|
|
if (do_archive_index && !check_all)
|
|
- error (_("File %s is not an archive so its index cannot be displayed.\n"),
|
|
- file_name);
|
|
+ error (_("Not an archive so its index cannot be displayed.\n"));
|
|
|
|
rewind (filedata->handle);
|
|
filedata->archive_file_size = filedata->archive_file_offset = 0;
|
|
|
|
- if (! process_object (filedata))
|
|
- ret = false;
|
|
+ if (process_object (filedata))
|
|
+ ret = true;
|
|
}
|
|
|
|
- fclose (filedata->handle);
|
|
- free (filedata->section_headers);
|
|
- free (filedata->program_headers);
|
|
- free (filedata->string_table);
|
|
- free (filedata->dump.dump_sects);
|
|
- free (filedata);
|
|
+ done:
|
|
+ if (filedata)
|
|
+ {
|
|
+ if (filedata->handle != NULL)
|
|
+ fclose (filedata->handle);
|
|
+ free (filedata->section_headers);
|
|
+ free (filedata->program_headers);
|
|
+ free (filedata->string_table);
|
|
+ free (filedata->dump.dump_sects);
|
|
+ free (filedata);
|
|
+ }
|
|
+ free (program_name);
|
|
+ program_name = saved_program_name;
|
|
|
|
free (ba_cache.strtab);
|
|
ba_cache.strtab = NULL;
|