• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂6951c20a00bc529c8f7efaafd7c2de690b2bfbbe (tree)
時間2019-09-24 22:05:32
作者Nick Alcock <nick.alcock@orac...>
CommiterNick Alcock

Log Message

objdump: get CTF parent importing right

The linker emits CTF into a single section named .ctf, which is a CTF
archive where the default member (itself named ".ctf", or simply NULL)
is the parent of all other members. Teach objdump to look for this by
default, rather than only trying to do it if a specific CTF parent
section was specified. (If no parent name is specified, we get the .ctf
member from the same section as everything else, which matches what the
linker generates.)

binutils/
* objdump.c (dump_ctf): Use the default CTF archive member as the
parent even when no parent section is specified.
(dump_ctf_archive_member): Only import from the parent
if this is not the default ".ctf" member.

Change Summary

差異

--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,10 @@
1+2019-08-03 Nick Alcock <nick.alcock@oracle.com>
2+
3+ * objdump.c (dump_ctf): Use the default CTF archive member as the
4+ parent even when no parent section is specified.
5+ (dump_ctf_archive_member): Only import from the parent
6+ if this is not the default ".ctf" member.
7+
18 2019-09-23 Nick Alcock <nick.alcock@oracle.com>
29
310 * Makefile.am (LIBCTF): Mention the .la file.
--- a/binutils/doc/ctf.options.texi
+++ b/binutils/doc/ctf.options.texi
@@ -10,5 +10,6 @@ contain many subsections, all of which are displayed in order.
1010
1111 @item --ctf-parent=@var{section}
1212
13-Specify the name of another section from which the CTF file can inherit
14-types.
13+Specify the name of another section from which the CTF dictionary can inherit
14+types. (If none is specified, we assume the CTF dictionary inherits types
15+from the default-named member of the archive contained within this section.)
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -3290,11 +3290,18 @@ dump_ctf_archive_member (ctf_file_t *ctf, const char *name, void *arg)
32903290
32913291 /* Only print out the name of non-default-named archive members.
32923292 The name .ctf appears everywhere, even for things that aren't
3293- really archives, so printing it out is liable to be confusing. */
3293+ really archives, so printing it out is liable to be confusing.
3294+
3295+ The parent, if there is one, is the default-owned archive member:
3296+ avoid importing it into itself. (This does no harm, but looks
3297+ confusing.) */
3298+
32943299 if (strcmp (name, ".ctf") != 0)
3295- printf (_("\nCTF archive member: %s:\n"), sanitize_string (name));
3300+ {
3301+ printf (_("\nCTF archive member: %s:\n"), sanitize_string (name));
3302+ ctf_import (ctf, parent);
3303+ }
32963304
3297- ctf_import (ctf, parent);
32983305 for (i = 0, thing = things; *thing[0]; thing++, i++)
32993306 {
33003307 ctf_dump_state_t *s = NULL;
@@ -3323,7 +3330,7 @@ dump_ctf_archive_member (ctf_file_t *ctf, const char *name, void *arg)
33233330 static void
33243331 dump_ctf (bfd *abfd, const char *sect_name, const char *parent_name)
33253332 {
3326- ctf_archive_t *ctfa, *parenta = NULL;
3333+ ctf_archive_t *ctfa, *parenta = NULL, *lookparent;
33273334 bfd_byte *ctfdata, *parentdata = NULL;
33283335 bfd_size_type ctfsize, parentsize;
33293336 ctf_sect_t ctfsect;
@@ -3356,14 +3363,18 @@ dump_ctf (bfd *abfd, const char *sect_name, const char *parent_name)
33563363 bfd_fatal (bfd_get_filename (abfd));
33573364 }
33583365
3359- /* Assume that the applicable parent archive member is the default one.
3360- (This is what all known implementations are expected to do, if they
3361- put CTFs and their parents in archives together.) */
3362- if ((parent = ctf_arc_open_by_name (parenta, NULL, &err)) == NULL)
3363- {
3364- non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err));
3365- bfd_fatal (bfd_get_filename (abfd));
3366- }
3366+ lookparent = parenta;
3367+ }
3368+ else
3369+ lookparent = ctfa;
3370+
3371+ /* Assume that the applicable parent archive member is the default one.
3372+ (This is what all known implementations are expected to do, if they
3373+ put CTFs and their parents in archives together.) */
3374+ if ((parent = ctf_arc_open_by_name (lookparent, NULL, &err)) == NULL)
3375+ {
3376+ non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err));
3377+ bfd_fatal (bfd_get_filename (abfd));
33673378 }
33683379
33693380 printf (_("Contents of CTF section %s:\n"), sanitize_string (sect_name));