1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/test/tools
Xing GUO 91f02ebcd5 [BinaryFormat] Add DT_USED tag into dynamic section.
Summary:
This tag is documented in https://docs.oracle.com/cd/E19253-01/817-1984/chapter6-42444/index.html 
Though I could not find some docs that describe it in detail, I found some code snippets.

1.
```
	/*
	 * Look up the string in the string table and get its offset. If
	 * this succeeds, then it is possible that there is a DT_NEEDED
	 * dynamic entry that references it.
	 */
	have_string = elfedit_sec_findstr(argstate->str.sec,
	    strpad_elt.dn_dyn.d_un.d_val, arg, &str_offset) != 0;
	if (have_string) {
		dyn = argstate->dynamic.data;
		for (ndx = 0; ndx < numdyn; dyn++, ndx++) {
			if (((dyn->d_tag == DT_NEEDED) ||
			    (dyn->d_tag == DT_USED)) &&
			    (dyn->d_un.d_val == str_offset))
				goto done;
		}
	}
```
80192cd83b/usr/src/cmd/sgs/elfedit/modules/common/syminfo.c (L512)

2.
```
    case DT_USED:
    case DT_INIT_ARRAY:
    case DT_FINI_ARRAY:
      if (do_dynamic)
        {
          if (entry->d_tag == DT_USED
          && VALID_DYNAMIC_NAME (entry->d_un.d_val))
        {
          char *name = GET_DYNAMIC_NAME (entry->d_un.d_val);

          if (*name)
            {
              printf (_("Not needed object: [%s]\n"), name);
              break;
            }
        }

          print_vma (entry->d_un.d_val, PREFIX_HEX);
          putchar ('\n');
        }
      break;
```
http://web.mit.edu/freebsd/head/contrib/binutils/binutils/readelf.c

3.
```
#define DT_USED     0x7ffffffe  /* ignored - same as needed */
```
https://github.com/switchbrew/switch-tools/blob/master/src/elf_common.h

Reviewers: jhenderson, grimar

Reviewed By: jhenderson, grimar

Subscribers: emaste, krytarowski, fedor.sergeev, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58762

llvm-svn: 355468
2019-03-06 01:28:40 +00:00
..
dsymutil dsymutil support for DW_OP_convert 2019-02-28 22:12:32 +00:00
gold
llvm-ar [llvm-ar] Implement the P modifier. 2019-02-14 18:35:13 +00:00
llvm-cfi-verify
llvm-config
llvm-cov [llvm-cov] Add support for gcov --hash-filenames option 2019-02-19 20:45:00 +00:00
llvm-cvtres
llvm-cxxdump
llvm-cxxfilt [llvm-cxxfilt] Re-enable split and demangle stdin input on certain non-alphanumerics. 2019-02-27 21:39:11 +00:00
llvm-cxxmap
llvm-diff
llvm-dlltool
llvm-dwarfdump [DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets. 2019-03-05 23:47:22 +00:00
llvm-dwp [llvm-dwp] Avoid writing the output dwp file when there is an error 2019-02-12 20:00:51 +00:00
llvm-elfabi [yaml2obj][obj2yaml] - Add support for dumping/parsing .dynamic sections. 2019-02-09 11:34:28 +00:00
llvm-exegesis [llvm-exegesis] Teach llvm-exegesis to handle instructions with multiple tied variables. 2019-02-26 10:54:45 +00:00
llvm-extract
llvm-isel-fuzzer
llvm-lib [llvm-ar][libObject] Fix relative paths when nesting thin archives. 2019-02-13 23:39:41 +00:00
llvm-lit
llvm-lto
llvm-lto2
llvm-mc
llvm-mca [MCA] Highlight kernel bottlenecks in the summary view. 2019-03-04 11:52:34 +00:00
llvm-modextract
llvm-mt
llvm-nm [WebAssembly] Remove uses of ThreadModel 2019-02-28 18:39:08 +00:00
llvm-objcopy [llvm-objcopy] - Simplify isCompressable and fix the issue relative. 2019-03-05 13:07:43 +00:00
llvm-objdump [llvm-objdump] Should print unknown d_tag in hex format 2019-03-02 04:20:28 +00:00
llvm-opt-fuzzer
llvm-opt-report
llvm-pdbdump [NativePDB] Fix access to both old & new fpo data entries from dbi stream 2019-01-30 10:40:45 +00:00
llvm-profdata
llvm-rc
llvm-readobj [llvm-readobj] Display section names for STT_SECTION symbols. 2019-03-01 17:31:32 +00:00
llvm-size
llvm-split
llvm-strings
llvm-symbolizer [symbolizer] Avoid collecting symbols belonging to invalid sections. 2019-02-14 23:50:35 +00:00
llvm-xray/X86
lto
obj2yaml [BinaryFormat] Add DT_USED tag into dynamic section. 2019-03-06 01:28:40 +00:00
opt-viewer [opt-viewer] Add --filter option to select remarks for displaying. 2019-02-06 18:43:37 +00:00
sancov
sanstats
yaml2obj [yaml2obj] - Allow setting custom sh_info for RawContentSection sections. 2019-03-01 10:18:16 +00:00