llvm-project/llvm/test/tools
Xing GUO dd440675cf [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 Remove irrelevant references to legacy git repositories from 2019-01-15 16:18:52 +00:00
llvm-ar [llvm-ar] Implement the P modifier. 2019-02-14 18:35:13 +00:00
llvm-cfi-verify [cfi-verify] Support cross-DSO 2018-08-24 15:21:58 +00:00
llvm-config [gn build] Commit change that should have been in r350410. 2019-01-04 17:26:05 +00:00
llvm-cov [llvm-cov] Add support for gcov --hash-filenames option 2019-02-19 20:45:00 +00:00
llvm-cvtres [opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append "[options] <inputs>" 2018-10-10 00:15:31 +00:00
llvm-cxxdump [llvm-cxxdump] Use error reporting helpers from support 2018-11-11 01:24:02 +00:00
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 Add flag to llvm-profdata to allow symbols in profile data to be remapped, and 2018-09-13 20:22:02 +00:00
llvm-diff llvm-diff: Fix crash on anonymous functions 2018-09-24 04:42:13 +00:00
llvm-dlltool [COFF] Adjust how we flag weak externals 2018-07-20 20:48:29 +00:00
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 [hot-cold-split] Name split functions with ".cold" suffix 2018-10-24 18:53:47 +00:00
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 [NewPM] teach -passes= to emit meaningful error messages 2018-10-17 10:36:23 +00:00
llvm-mc Replace unused output filenames with /dev/null in tests 2018-07-02 18:16:44 +00:00
llvm-mca [MCA] Highlight kernel bottlenecks in the summary view. 2019-03-04 11:52:34 +00:00
llvm-modextract
llvm-mt [llvm-mt] Use WithColor for printing errors. 2018-06-23 16:49:07 +00:00
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 [NewPM] teach -passes= to emit meaningful error messages 2018-10-17 10:36:23 +00:00
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-profdata] add value-cutoff functionality in show command 2019-01-08 22:41:48 +00:00
llvm-rc [llvm-rc] Support '--' for delimiting options from input paths 2019-01-16 08:09:22 +00:00
llvm-readobj [llvm-readobj] Display section names for STT_SECTION symbols. 2019-03-01 17:31:32 +00:00
llvm-size [llvm-size][libobject] Add explicit "inTextSegment" methods similar to "isText" section methods to calculate size correctly. 2018-12-13 19:40:12 +00:00
llvm-split
llvm-strings [llvm-strings] Fix whitespaces to match strings output. 2018-11-09 18:03:21 +00:00
llvm-symbolizer [symbolizer] Avoid collecting symbols belonging to invalid sections. 2019-02-14 23:50:35 +00:00
llvm-xray/X86 [llvm-xray] Support for PIE 2018-12-14 01:37:56 +00:00
lto [LTO] Change test/tools/lto/no-bitcode.s requirement from arm to aarch64 2019-01-18 15:57:59 +00:00
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 [cfi] Help sanstats to find binary if they are not at the original location 2018-11-26 21:48:55 +00:00
yaml2obj [yaml2obj] - Allow setting custom sh_info for RawContentSection sections. 2019-03-01 10:18:16 +00:00