Advertisement
Guest User

mipslinux mt7621 gcc/g++/binutils+{glibc,bash}/-{bzBox,musl}

a guest
Sep 20th, 2017
1,029
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 39.54 KB | None | 0 0
  1. previous logs:
  2. 1 https://pastebin.com/gyzLGKEs first successful mips32 compile
  3. 2 https://pastebin.com/nHzYRDps copied over missing libc files/tidied up (missed copying c++ over in this one)
  4. 3 https://pastebin.com/AzFHxnPD libqmi (glib 2.52 and util-linux 2.29 upgraded as well)
  5. 4 https://pastebin.com/Cyh8eivj minidlna update
  6. 5 https://pastebin.com/L9w8arvC gudev added
  7. 6 https://pastebin.com/h2xFLf2V php7 updates etc
  8. 7 https://pastebin.com/bHPpZrRx updated ar71xx for 4.9 (also did it for ar934x platform ["wasp"--mips74k])
  9. 8 https://pastebin.com/zsdTjjKQ status update on the firmware (not really exclusive to the AC55U, just packing it using mkimage vs lzma-loader etc).
  10. 9 https://pastebin.com/qNMiWkD9 failure of AC55U due to sensitive MTD flash partitioning (likely due to shoe-horning of AR7134 devicetree file for QCA9558)
  11. 10 https://pastebin.com/1BPUmMzx just an update to glibc 2.29 and using the latest 4.9 committed by brainslayer to ensure we're all on teh same page.
  12. 11 https://pastebin.com/9jrT1gkP raw bootlog from the r6700v2/r6800/r6900v2. included so people can observe how the u-boot and "stage  code seem to be "together"; that is, the u-boot seems to be customised to deal with the sercomm utilities (no mtdparts, but there is an sc_nand).
  13. 12 https://pastebin.com/TJHeu9VC discussing the sercomm boot tools and such.
  14. 13 https://pastebin.com/uadhgmvS just showing the boot log (without initramfs enabled).
  15. 14 https://pastebin.com/jNmY4y9D was just sharing the observation about initrd that wasn't really useful to the problem
  16. 15 https://pastebin.com/EUeDuLHZ briefly discussing the boot and problem with the dtb (device tree binary) not being "seen" by the kernel
  17. 16 https://pastebin.com/K7yuBYfv just a nothingness update (talking about clocksource driver being picked up when disabling the devicetree node calls in mt7621.c)
  18. 17 https://pastebin.com/LAewauYh discussing the devicetree hack created by The oh-so-clever Crispy One John Crispin (blogic), and how it must be used instead of the "appended_dtb" kernel configuration options. also pointed out the resulting file system driver issue
  19. 18 https://pastebin.com/uMBaREgn expressing my justified frustration at being unable to mount the bloody filesystem, which is/was likely caused by the network devices having "priority" on the CPU cores, thereby creating a "lock' that can only be opened with the drivers.
  20. 19 https://pastebin.com/nqYDn4XD successful driver loading, and the rdinit allows the sercommised firmware to "let go" and release the kernel for further booting. this is where i bricked my router trying to update/flash a compiled u-boot. at least i got this build to dump the stack before it died (https://pastebin.com/g1fsrWtm remember, it's MIPS!)
  21. 20 https://pastebin.com/ux4jky9c just discussing the transition to a d-link dir882 and the issue with the ralink_nand driver.
  22. 21 https://pastebin.com/m0Fer8cM just talking about wrapping ralink_nand.h.
  23. 22 https://pastebin.com/sDSU1JZg discussing RDinit success (in the sense that it works) when using DLINK's uclibc romfs, but no such success when invoking glibc-linked programs.
  24. 23 discussing the successful boot with initrd of a uclibc image
  25.  
  26. today was a good day.
  27.  
  28. i have managed to get a static gcc/g++ (with static binutils) fully working, linked to _glibc_. i haven't tested it thoroughly, but it was able to compile a program that called printf, where this gcc called as to complete the linkage.
  29.  
  30. this is extremely exciting, even in light of the real limitations at boot!!!! below is a dump of some of the output from this build...
  31.  
  32. they said it couldn't be done...
  33. #mipslinux#mipslinux#mipslinux#mipslinux#mipslinux#mipslinux#mipslinux#mipslinux#mipslinux#mipslinux#mipslinux#mipslinux#mipslinux#mipslinux#mipslinux
  34. sh-4.4# help
  35. GNU bash, version 4.4.12(3)-release (mipsel-none-linux-gnu)
  36. These shell commands are defined internally.  Type `help' to see this list.
  37. Type `help name' to find out more about the function `name'.
  38. Use `info bash' to find out more about the shell in general.
  39. Use `man -k' or `info' to find out more about commands not in this list.
  40.  
  41. A star (*) next to a name means that the command is disabled.
  42.  
  43.  job_spec [&]                            if COMMANDS; then COMMANDS; [ elif C>
  44. (( expression ))                        kill [-s sigspec | -n signum | -sigs>
  45. . filename [arguments]                  let arg [arg ...]
  46.  :                                       local [option] name[=value] ...
  47.  [ arg... ]                              logout [n]
  48.  [[ expression ]]                        mapfile [-d delim] [-n count] [-O or>
  49. alias [-p] [name[=value] ... ]          popd [-n] [+N | -N]
  50.  bind [-lpsvPSVX] [-m keymap] [-f file>  printf [-v var] format [arguments]
  51.  break [n]                               pushd [-n] [+N | -N | dir]
  52.  builtin [shell-builtin [arg ...]]       pwd [-LP]
  53.  caller [expr]                           read [-ers] [-a array] [-d delim] [->
  54. case WORD in [PATTERN [| PATTERN]...)>  readarray [-n count] [-O origin] [-s>
  55. cd [-L|[-P [-e]] [-@]] [dir]            readonly [-aAf] [name[=value] ...] o>
  56.  command [-pVv] command [arg ...]        return [n]
  57.  compgen [-abcdefgjksuv] [-o option] [>  select NAME [in WORDS ... ;] do COMM>
  58.  complete [-abcdefgjksuv] [-pr] [-DE] >  set [-abefhkmnptuvxBCHP] [-o option->
  59. compopt [-o|+o option] [-DE] [name ..>  shift [n]
  60.  continue [n]                            shopt [-pqsu] [-o] [optname ...]
  61.  coproc [NAME] command [redirections]    source filename [arguments]
  62.  declare [-aAfFgilnrtux] [-p] [name[=v>  test [expr]
  63.  dirs [-clpv] [+N] [-N]                  time [-p] pipeline
  64.  echo [-neE] [arg ...]                   times
  65.  enable [-a] [-dnps] [-f filename] [na>  trap [-lp] [[arg] signal_spec ...]
  66.  eval [arg ...]                          true
  67.  exec [-cl] [-a name] [command [argume>  type [-afptP] name [name ...]
  68.  exit [n]                                typeset [-aAfFgilnrtux] [-p] name[=v>
  69. export [-fn] [name[=value] ...] or ex>  ulimit [-SHabcdefiklmnpqrstuvxPT] [l>
  70. false                                   umask [-p] [-S] [mode]
  71.  fc [-e ename] [-lnr] [first] [last] o>  unalias [-a] name [name ...]
  72.  for NAME [in WORDS ... ] ; do COMMAND>  unset [-f] [-v] [-n] [name ...]
  73.  for (( exp1; exp2; exp3 )); do COMMAN>  until COMMANDS; do COMMANDS; done
  74.  function name { COMMANDS ; } or name >  variables - Names and meanings of so>
  75. getopts optstring name [arg]            wait [pid ...]
  76. hash [-lr] [-p pathname] [-dt] [name >  while COMMANDS; do COMMANDS; done
  77. help [-dms] [pattern ...]               { COMMANDS ; }
  78. history [-c] [-d offset] [n] or histo>
  79. sh-4.4# gcc -v
  80. Using built-in specs.
  81. COLLECT_GCC=gcc
  82. COLLECT_LTO_WRAPPER=/mnt/root/bin/../libexec/gcc/mipsel-none-linux-gnu/7.2.0/lto-wrapper
  83. Target: mipsel-none-linux-gnu
  84. Configured with: ../gcc7/configure --prefix=/tools --libdir=/tools/lib --build=x86_64-cross-darwin14 --host=mipsel-none-linux-gnu --target=mipsel-none-linux-gnu --with-local-prefix=/tools --enable-languages=c,c++ --with-system-zlib <SNIPPED BY BROLY>
  85. Thread model: posix
  86. gcc version 7.2.0 (GCC)
  87. sh-4.4# g++ -v
  88. Using built-in specs.
  89. COLLECT_GCC=g++
  90. COLLECT_LTO_WRAPPER=/mnt/root/bin/../libexec/gcc/mipsel-none-linux-gnu/7.2.0/lto-wrapper
  91. Target: mipsel-none-linux-gnu
  92. Configured with: ../gcc7/configure --prefix=/tools --libdir=/tools/lib --build=x86_64-cross-darwin14 --host=mipsel-none-linux-gnu --target=mipsel-none-linux-gnu --with-local-prefix=/tools --enable-languages=c,c++ --with-system-zlib <SNIPPED BY BROLY>
  93. Thread model: posix
  94. gcc version 7.2.0 (GCC)
  95. sh-4.4# cat t
  96. tmp/   tools/
  97. sh-4.4# cat /mnt/root/bin/test.c
  98. #include <stdlib.h>
  99.  
  100. int main() {
  101.  
  102.  
  103.        printf("Hi\n");
  104. }
  105.  
  106. sh-4.4# pwd  
  107. /
  108. sh-4.4# cd /mnt/root/bin
  109. sh-4.4# rm a.out    
  110. sh-4.4# gcc test.c
  111. test.c:1:10: fatal error: stdlib.h: No such file or directory
  112. #include <stdlib.h>
  113.          ^~~~~~~~~~
  114. compilation terminated.
  115. sh-4.4# gcc -I/mnt/root/include test.c
  116. test.c: In function 'main':
  117. test.c:6:2: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
  118.  printf("Hi\n");
  119.  ^~~~~~
  120. test.c:6:2: warning: incompatible implicit declaration of built-in function 'printf'
  121. test.c:6:2: note: include '<stdio.h>' or provide a declaration of 'printf'
  122. sh-4.4# ./a.out
  123. Hi
  124. sh-4.4# ar  
  125. Usage: ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
  126.       ar -M [<mri-script]
  127. commands:
  128.  d            - delete file(s) from the archive
  129.  m[ab]        - move file(s) in the archive
  130.  p            - print file(s) found in the archive
  131.  q[f]         - quick append file(s) to the archive
  132.  r[ab][f][u]  - replace existing or insert new file(s) into the archive
  133.  s            - act as ranlib
  134.  t            - display contents of archive
  135.  x[o]         - extract file(s) from the archive
  136. command specific modifiers:
  137.  [a]          - put file(s) after [member-name]
  138.  [b]          - put file(s) before [member-name] (same as [i])
  139.  [D]          - use zero for timestamps and uids/gids
  140.  [U]          - use actual timestamps and uids/gids (default)
  141.  [N]          - use instance [count] of name
  142.  [f]          - truncate inserted file names
  143.  [P]          - use full path names when matching
  144.  [o]          - preserve original dates
  145.  [u]          - only replace files that are newer than current archive contents
  146. generic modifiers:
  147.  [c]          - do not warn if the library had to be created
  148.  [s]          - create an archive index (cf. ranlib)
  149.  [S]          - do not build a symbol table
  150.  [T]          - make a thin archive
  151.  [v]          - be verbose
  152.  [V]          - display the version number
  153.  @<file>      - read options from <file>
  154.  --target=BFDNAME - specify the target object format as BFDNAME
  155. optional:
  156.  --plugin <p> - load the specified plugin
  157. emulation options:
  158.  No emulation specific options
  159. ar: supported targets: elf32-tradlittlemips elf32-tradbigmips ecoff-littlemips ecoff-bigmips elf32-ntradlittlemips elf64-tradlittlemips elf32-ntradbigmips elf64-tradbigmips elf64-little elf64-big elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
  160. sh-4.4# as
  161.  
  162. ^C
  163. sh-4.4# as --help
  164. Usage: as [option...] [asmfile...]
  165. Options:
  166.  -a[sub-option...]       turn on listings
  167.                          Sub-options [default hls]:
  168.                          c      omit false conditionals
  169.                          d      omit debugging directives
  170.                          g      include general info
  171.                          h      include high-level source
  172.                          l      include assembly
  173.                          m      include macro expansions
  174.                          n      omit forms processing
  175.                          s      include symbols
  176.                          =FILE  list to FILE (must be last sub-option)
  177.  --alternate             initially turn on alternate macro syntax
  178.  --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]
  179.                          compress DWARF debug sections using zlib
  180.  --nocompress-debug-sections
  181.                          don't compress DWARF debug sections [default]
  182.  -D                      produce assembler debugging messages
  183.  --debug-prefix-map OLD=NEW
  184.                          map OLD to NEW in debug information
  185.  --defsym SYM=VAL        define symbol SYM to given value
  186.  --em=[mipslelf | mipsbelf | mipself]
  187.                          emulate output (default mipslelf)
  188.  --execstack             require executable stack for this object
  189.  --noexecstack           don't require executable stack for this object
  190.  --size-check=[error|warning]
  191.                          ELF .size directive check (default --size-check=error)
  192.  --elf-stt-common=[no|yes]
  193.                          generate ELF common symbols with STT_COMMON type
  194.  --sectname-subst        enable section name substitution sequences
  195.  -f                      skip whitespace and comment preprocessing
  196.  -g --gen-debug          generate debugging information
  197.  --gstabs                generate STABS debugging information
  198.  --gstabs+               generate STABS debug info with GNU extensions
  199.  --gdwarf-2              generate DWARF2 debugging information
  200.  --gdwarf-sections       generate per-function section names for DWARF line information
  201.  --hash-size=<value>     set the hash table size close to <value>
  202.  --help                  show this message and exit
  203.  --target-help           show target specific options
  204.  -I DIR                  add DIR to search list for .include directives
  205.  -J                      don't warn about signed overflow
  206.  -K                      warn when differences altered for long displacements
  207.  -L,--keep-locals        keep local symbols (e.g. starting with `L')
  208.  -M,--mri                assemble in MRI compatibility mode
  209.  --MD FILE               write dependency information in FILE (default none)
  210.  -nocpp                  ignored
  211.  -no-pad-sections        do not pad the end of sections to alignment boundaries
  212.  -o OBJFILE              name the object-file output OBJFILE (default a.out)
  213.  -R                      fold data section into text section
  214.  --reduce-memory-overheads
  215.                          prefer smaller memory use at the cost of longer
  216.                          assembly times
  217.  --statistics            print various measured statistics from execution
  218.  --strip-local-absolute  strip local absolute symbols
  219.  --traditional-format    Use same format as native assembler when possible
  220.  --version               print assembler version number and exit
  221.  -W  --no-warn           suppress warnings
  222.  --warn                  don't suppress warnings
  223.  --fatal-warnings        treat warnings as errors
  224.  --itbl INSTTBL          extend instruction set to include instructions
  225.                          matching the specifications defined in file INSTTBL
  226.  -w                      ignored
  227.  -X                      ignored
  228.  -Z                      generate object file even after errors
  229.  --listing-lhs-width     set the width in words of the output data column of
  230.                          the listing
  231.  --listing-lhs-width2    set the width in words of the continuation lines
  232.                          of the output data column; ignored if smaller than
  233.                          the width of the first line
  234.  --listing-rhs-width     set the max width in characters of the lines from
  235.                          the source file
  236.  --listing-cont-lines    set the maximum number of continuation lines used
  237.                          for the output data column of the listing
  238.  @FILE                   read options from FILE
  239. MIPS options:
  240. -EB                     generate big endian output
  241. -EL                     generate little endian output
  242. -g, -g2                 do not remove unneeded NOPs or swap branches
  243. -G NUM                  allow referencing objects up to NUM bytes
  244.                        implicitly with the gp register [default 8]
  245. -mips1                  generate MIPS ISA I instructions
  246. -mips2                  generate MIPS ISA II instructions
  247. -mips3                  generate MIPS ISA III instructions
  248. -mips4                  generate MIPS ISA IV instructions
  249. -mips5                  generate MIPS ISA V instructions
  250. -mips32                 generate MIPS32 ISA instructions
  251. -mips32r2               generate MIPS32 release 2 ISA instructions
  252. -mips32r3               generate MIPS32 release 3 ISA instructions
  253. -mips32r5               generate MIPS32 release 5 ISA instructions
  254. -mips32r6               generate MIPS32 release 6 ISA instructions
  255. -mips64                 generate MIPS64 ISA instructions
  256. -mips64r2               generate MIPS64 release 2 ISA instructions
  257. -mips64r3               generate MIPS64 release 3 ISA instructions
  258. -mips64r5               generate MIPS64 release 5 ISA instructions
  259. -mips64r6               generate MIPS64 release 6 ISA instructions
  260. -march=CPU/-mtune=CPU   generate code/schedule for CPU, where CPU is one of:
  261.                        mips1, mips2, mips3, mips4, mips5, mips32,
  262.                        mips32r2, mips32r3, mips32r5, mips32r6, mips64,
  263.                        mips64r2, mips64r3, mips64r5, mips64r6, r3000,
  264.                        r2000, r3900, r6000, r4000, r4010, vr4100,
  265.                        vr4111, vr4120, vr4130, vr4181, vr4300, r4400,
  266.                        r4600, orion, r4650, r5900, loongson2e,
  267.                        loongson2f, r8000, r10000, r12000, r14000,
  268.                        r16000, vr5000, vr5400, vr5500, rm5200, rm5230,
  269.                        rm5231, rm5261, rm5721, rm7000, rm9000, 4kc, 4km,
  270.                        4kp, 4ksc, 4kec, 4kem, 4kep, 4ksd, m4k, m4kp,
  271.                        m14k, m14kc, m14ke, m14kec, 24kc, 24kf2_1, 24kf,
  272.                        24kf1_1, 24kfx, 24kx, 24kec, 24kef2_1, 24kef,
  273.                        24kef1_1, 24kefx, 24kex, 34kc, 34kf2_1, 34kf,
  274.                        34kf1_1, 34kfx, 34kx, 34kn, 74kc, 74kf2_1, 74kf,
  275.                        74kf1_1, 74kf3_2, 74kfx, 74kx, 1004kc, 1004kf2_1,
  276.                        1004kf, 1004kf1_1, interaptiv, interaptiv-mr2,
  277.                        m5100, m5101, p5600, 5kc, 5kf, 20kc, 25kf, sb1,
  278.                        sb1a, loongson3a, octeon, octeon+, octeon2,
  279.                        octeon3, xlr, xlp, i6400, p6600, from-abi
  280. -mCPU                   equivalent to -march=CPU -mtune=CPU. Deprecated.
  281. -no-mCPU                don't generate code specific to CPU.
  282.                        For -mCPU and -no-mCPU, CPU must be one of:
  283.                        3900, 4010, 4100, 4650
  284. -mips16                 generate mips16 instructions
  285. -no-mips16              do not generate mips16 instructions
  286. -mmicromips             generate microMIPS instructions
  287. -mno-micromips          do not generate microMIPS instructions
  288. -msmartmips             generate smartmips instructions
  289. -mno-smartmips          do not generate smartmips instructions
  290. -mdsp                   generate DSP instructions
  291. -mno-dsp                do not generate DSP instructions
  292. -mdspr2                 generate DSP R2 instructions
  293. -mno-dspr2              do not generate DSP R2 instructions
  294. -mdspr3                 generate DSP R3 instructions
  295. -mno-dspr3              do not generate DSP R3 instructions
  296. -mmt                    generate MT instructions
  297. -mno-mt                 do not generate MT instructions
  298. -mmcu                   generate MCU instructions
  299. -mno-mcu                do not generate MCU instructions
  300. -mmsa                   generate MSA instructions
  301. -mno-msa                do not generate MSA instructions
  302. -mxpa                   generate eXtended Physical Address (XPA) instructions
  303. -mno-xpa                do not generate eXtended Physical Address (XPA) instructions
  304. -mvirt                  generate Virtualization instructions
  305. -mno-virt               do not generate Virtualization instructions
  306. -minsn32                only generate 32-bit microMIPS instructions
  307. -mno-insn32             generate all microMIPS instructions
  308. -mfix-loongson2f-jump   work around Loongson2F JUMP instructions
  309. -mfix-loongson2f-nop    work around Loongson2F NOP errata
  310. -mfix-vr4120            work around certain VR4120 errata
  311. -mfix-vr4130            work around VR4130 mflo/mfhi errata
  312. -mfix-24k               insert a nop after ERET and DERET instructions
  313. -mfix-cn63xxp1          work around CN63XXP1 PREF errata
  314. -mgp32                  use 32-bit GPRs, regardless of the chosen ISA
  315. -mfp32                  use 32-bit FPRs, regardless of the chosen ISA
  316. -msym32                 assume all symbols have 32-bit values
  317. -O0                     remove unneeded NOPs, do not swap branches
  318. -O                      remove unneeded NOPs and swap branches
  319. --trap, --no-break      trap exception on div by 0 and mult overflow
  320. --break, --no-trap      break exception on div by 0 and mult overflow
  321. -mhard-float            allow floating-point instructions
  322. -msoft-float            do not allow floating-point instructions
  323. -msingle-float          only allow 32-bit floating-point operations
  324. -mdouble-float          allow 32-bit and 64-bit floating-point operations
  325. --[no-]construct-floats [dis]allow floating point values to be constructed
  326. --[no-]relax-branch     [dis]allow out-of-range branches to be relaxed
  327. -mignore-branch-isa     accept invalid branches requiring an ISA mode switch
  328. -mno-ignore-branch-isa  reject invalid branches requiring an ISA mode switch
  329. -mnan=ENCODING          select an IEEE 754 NaN encoding convention, either of:
  330.                        legacy, 2008
  331. -KPIC, -call_shared     generate SVR4 position independent code
  332. -call_nonpic            generate non-PIC code that can operate with DSOs
  333. -mvxworks-pic           generate VxWorks position independent code
  334. -non_shared             do not generate code that can operate with DSOs
  335. -xgot                   assume a 32 bit GOT
  336. -mpdr, -mno-pdr         enable/disable creation of .pdr sections
  337. -mshared, -mno-shared   disable/enable .cpload optimization for
  338.                        position dependent (non shared) code
  339. -mabi=ABI               create ABI conformant object file for:
  340.                        32, o64, n32, 64, eabi
  341. -32                     create o32 ABI object file (default)
  342. -n32                    create n32 ABI object file
  343. -64                     create 64 ABI object file
  344.  
  345. Report bugs to <http://www.sourceware.org/bugzilla/>
  346. sh-4.4# objcopy  
  347. Usage: objcopy [option(s)] in-file [out-file]
  348. Copies a binary file, possibly transforming it in the process
  349. The options are:
  350.  -I --input-target <bfdname>      Assume input file is in format <bfdname>
  351.  -O --output-target <bfdname>     Create an output file in format <bfdname>
  352.  -B --binary-architecture <arch>  Set output arch, when input is arch-less
  353.  -F --target <bfdname>            Set both input and output format to <bfdname>
  354.     --debugging                   Convert debugging information, if possible
  355.  -p --preserve-dates              Copy modified/access timestamps to the output
  356.  -D --enable-deterministic-archives
  357.                                   Produce deterministic output when stripping archives
  358.  -U --disable-deterministic-archives
  359.                                   Disable -D behavior (default)
  360.  -j --only-section <name>         Only copy section <name> into the output
  361.     --add-gnu-debuglink=<file>    Add section .gnu_debuglink linking to <file>
  362.  -R --remove-section <name>       Remove section <name> from the output
  363.     --remove-relocations <name>   Remove relocations from section <name>
  364.  -S --strip-all                   Remove all symbol and relocation information
  365.  -g --strip-debug                 Remove all debugging symbols & sections
  366.     --strip-dwo                   Remove all DWO sections
  367.     --strip-unneeded              Remove all symbols not needed by relocations
  368.  -N --strip-symbol <name>         Do not copy symbol <name>
  369.     --strip-unneeded-symbol <name>
  370.                                   Do not copy symbol <name> unless needed by
  371.                                     relocations
  372.     --only-keep-debug             Strip everything but the debug information
  373.     --extract-dwo                 Copy only DWO sections
  374.     --extract-symbol              Remove section contents but keep symbols
  375.  -K --keep-symbol <name>          Do not strip symbol <name>
  376.     --keep-file-symbols           Do not strip file symbol(s)
  377.     --localize-hidden             Turn all ELF hidden symbols into locals
  378.  -L --localize-symbol <name>      Force symbol <name> to be marked as a local
  379.     --globalize-symbol <name>     Force symbol <name> to be marked as a global
  380.  -G --keep-global-symbol <name>   Localize all symbols except <name>
  381.  -W --weaken-symbol <name>        Force symbol <name> to be marked as a weak
  382.     --weaken                      Force all global symbols to be marked as weak
  383.  -w --wildcard                    Permit wildcard in symbol comparison
  384.  -x --discard-all                 Remove all non-global symbols
  385.  -X --discard-locals              Remove any compiler-generated symbols
  386.  -i --interleave[=<number>]       Only copy N out of every <number> bytes
  387.     --interleave-width <number>   Set N for --interleave
  388.  -b --byte <num>                  Select byte <num> in every interleaved block
  389.     --gap-fill <val>              Fill gaps between sections with <val>
  390.     --pad-to <addr>               Pad the last section up to address <addr>
  391.     --set-start <addr>            Set the start address to <addr>
  392.    {--change-start|--adjust-start} <incr>
  393.                                   Add <incr> to the start address
  394.    {--change-addresses|--adjust-vma} <incr>
  395.                                   Add <incr> to LMA, VMA and start addresses
  396.    {--change-section-address|--adjust-section-vma} <name>{=|+|-}<val>
  397.                                   Change LMA and VMA of section <name> by <val>
  398.     --change-section-lma <name>{=|+|-}<val>
  399.                                   Change the LMA of section <name> by <val>
  400.     --change-section-vma <name>{=|+|-}<val>
  401.                                   Change the VMA of section <name> by <val>
  402.    {--[no-]change-warnings|--[no-]adjust-warnings}
  403.                                   Warn if a named section does not exist
  404.     --set-section-flags <name>=<flags>
  405.                                   Set section <name>'s properties to <flags>
  406.     --add-section <name>=<file>   Add section <name> found in <file> to output
  407.     --update-section <name>=<file>
  408.                                   Update contents of section <name> with
  409.                                   contents found in <file>
  410.     --dump-section <name>=<file>  Dump the contents of section <name> into <file>
  411.     --rename-section <old>=<new>[,<flags>] Rename section <old> to <new>
  412.     --long-section-names {enable|disable|keep}
  413.                                   Handle long section names in Coff objects.
  414.     --change-leading-char         Force output format's leading character style
  415.     --remove-leading-char         Remove leading character from global symbols
  416.     --reverse-bytes=<num>         Reverse <num> bytes at a time, in output sections with content
  417.     --redefine-sym <old>=<new>    Redefine symbol name <old> to <new>
  418.     --redefine-syms <file>        --redefine-sym for all symbol pairs
  419.                                     listed in <file>
  420.     --srec-len <number>           Restrict the length of generated Srecords
  421.     --srec-forceS3                Restrict the type of generated Srecords to S3
  422.     --strip-symbols <file>        -N for all symbols listed in <file>
  423.     --strip-unneeded-symbols <file>
  424.                                   --strip-unneeded-symbol for all symbols listed
  425.                                     in <file>
  426.     --keep-symbols <file>         -K for all symbols listed in <file>
  427.     --localize-symbols <file>     -L for all symbols listed in <file>
  428.     --globalize-symbols <file>    --globalize-symbol for all in <file>
  429.     --keep-global-symbols <file>  -G for all symbols listed in <file>
  430.     --weaken-symbols <file>       -W for all symbols listed in <file>
  431.     --add-symbol <name>=[<section>:]<value>[,<flags>]  Add a symbol
  432.     --alt-machine-code <index>    Use the target's <index>'th alternative machine
  433.     --writable-text               Mark the output text as writable
  434.     --readonly-text               Make the output text write protected
  435.     --pure                        Mark the output file as demand paged
  436.     --impure                      Mark the output file as impure
  437.     --prefix-symbols <prefix>     Add <prefix> to start of every symbol name
  438.     --prefix-sections <prefix>    Add <prefix> to start of every section name
  439.     --prefix-alloc-sections <prefix>
  440.                                   Add <prefix> to start of every allocatable
  441.                                     section name
  442.     --file-alignment <num>        Set PE file alignment to <num>
  443.     --heap <reserve>[,<commit>]   Set PE reserve/commit heap to <reserve>/
  444.                                   <commit>
  445.     --image-base <address>        Set PE image base to <address>
  446.     --section-alignment <num>     Set PE section alignment to <num>
  447.     --stack <reserve>[,<commit>]  Set PE reserve/commit stack to <reserve>/
  448.                                   <commit>
  449.     --subsystem <name>[:<version>]
  450.                                   Set PE subsystem to <name> [& <version>]
  451.     --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]
  452.                                   Compress DWARF debug sections using zlib
  453.     --decompress-debug-sections   Decompress DWARF debug sections using zlib
  454.     --elf-stt-common=[yes|no]     Generate ELF common symbols with STT_COMMON
  455.                                     type
  456.  -M  --merge-notes                Remove redundant entries in note sections
  457.      --no-merge-notes             Do not attempt to remove redundant notes (default)
  458.  -v --verbose                     List all object files modified
  459.  @<file>                          Read options from <file>
  460.  -V --version                     Display this program's version number
  461.  -h --help                        Display this output
  462.     --info                        List object formats & architectures supported
  463. objcopy: supported targets: elf32-tradlittlemips elf32-tradbigmips ecoff-littlemips ecoff-bigmips elf32-ntradlittlemips elf64-tradlittlemips elf32-ntradbigmips elf64-tradbigmips elf64-little elf64-big elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
  464. sh-4.4# readelf
  465. Usage: readelf <option(s)> elf-file(s)
  466. Display information about the contents of ELF format files
  467. Options are:
  468.  -a --all               Equivalent to: -h -l -S -s -r -d -V -A -I
  469.  -h --file-header       Display the ELF file header
  470.  -l --program-headers   Display the program headers
  471.     --segments          An alias for --program-headers
  472.  -S --section-headers   Display the sections' header
  473.     --sections          An alias for --section-headers
  474.  -g --section-groups    Display the section groups
  475.  -t --section-details   Display the section details
  476.  -e --headers           Equivalent to: -h -l -S
  477.  -s --syms              Display the symbol table
  478.     --symbols           An alias for --syms
  479.  --dyn-syms             Display the dynamic symbol table
  480.  -n --notes             Display the core notes (if present)
  481.  -r --relocs            Display the relocations (if present)
  482.  -u --unwind            Display the unwind info (if present)
  483.  -d --dynamic           Display the dynamic section (if present)
  484.  -V --version-info      Display the version sections (if present)
  485.  -A --arch-specific     Display architecture specific information (if any)
  486.  -c --archive-index     Display the symbol/file index in an archive
  487.  -D --use-dynamic       Use the dynamic section info when displaying symbols
  488.  -x --hex-dump=<number|name>
  489.                         Dump the contents of section <number|name> as bytes
  490.  -p --string-dump=<number|name>
  491.                         Dump the contents of section <number|name> as strings
  492.  -R --relocated-dump=<number|name>
  493.                         Dump the contents of section <number|name> as relocated bytes
  494.  -z --decompress        Decompress section before dumping it
  495.  -w[lLiaprmfFsoRt] or
  496.  --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,
  497.               =frames-interp,=str,=loc,=Ranges,=pubtypes,
  498.               =gdb_index,=trace_info,=trace_abbrev,=trace_aranges,
  499.               =addr,=cu_index]
  500.                         Display the contents of DWARF2 debug sections
  501.  --dwarf-depth=N        Do not display DIEs at depth N or greater
  502.  --dwarf-start=N        Display DIEs starting with N, at the same depth
  503.                         or deeper
  504.  -I --histogram         Display histogram of bucket list lengths
  505.  -W --wide              Allow output width to exceed 80 characters
  506.  @<file>                Read options from <file>
  507.  -H --help              Display this information
  508.  -v --version           Display the version number of readelf
  509. sh-4.4# gcc --help  
  510. Usage: gcc [options] file...
  511. Options:
  512.  -pass-exit-codes         Exit with highest error code from a phase.
  513.  --help                   Display this information.
  514.  --target-help            Display target specific command line options.
  515.  --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].
  516.                           Display specific types of command line options.
  517.  (Use '-v --help' to display command line options of sub-processes).
  518.  --version                Display compiler version information.
  519.  -dumpspecs               Display all of the built in spec strings.
  520.  -dumpversion             Display the version of the compiler.
  521.  -dumpmachine             Display the compiler's target processor.
  522.  -print-search-dirs       Display the directories in the compiler's search path.
  523.  -print-libgcc-file-name  Display the name of the compiler's companion library.
  524.  -print-file-name=<lib>   Display the full path to library <lib>.
  525.  -print-prog-name=<prog>  Display the full path to compiler component <prog>.
  526.  -print-multiarch         Display the target's normalized GNU triplet, used as
  527.                           a component in the library path.
  528.  -print-multi-directory   Display the root directory for versions of libgcc.
  529.  -print-multi-lib         Display the mapping between command line options and
  530.                           multiple library search directories.
  531.  -print-multi-os-directory Display the relative path to OS libraries.
  532.  -print-sysroot           Display the target libraries directory.
  533.  -print-sysroot-headers-suffix Display the sysroot suffix used to find headers.
  534.  -Wa,<options>            Pass comma-separated <options> on to the assembler.
  535.  -Wp,<options>            Pass comma-separated <options> on to the preprocessor.
  536.  -Wl,<options>            Pass comma-separated <options> on to the linker.
  537.  -Xassembler <arg>        Pass <arg> on to the assembler.
  538.  -Xpreprocessor <arg>     Pass <arg> on to the preprocessor.
  539.  -Xlinker <arg>           Pass <arg> on to the linker.
  540.  -save-temps              Do not delete intermediate files.
  541.  -save-temps=<arg>        Do not delete intermediate files.
  542.  -no-canonical-prefixes   Do not canonicalize paths when building relative
  543.                           prefixes to other gcc components.
  544.  -pipe                    Use pipes rather than intermediate files.
  545.  -time                    Time the execution of each subprocess.
  546.  -specs=<file>            Override built-in specs with the contents of <file>.
  547.  -std=<standard>          Assume that the input sources are for <standard>.
  548.  --sysroot=<directory>    Use <directory> as the root directory for headers
  549.                           and libraries.
  550.  -B <directory>           Add <directory> to the compiler's search paths.
  551.  -v                       Display the programs invoked by the compiler.
  552.  -###                     Like -v but options quoted and commands not executed.
  553.  -E                       Preprocess only; do not compile, assemble or link.
  554.  -S                       Compile only; do not assemble or link.
  555.  -c                       Compile and assemble, but do not link.
  556.  -o <file>                Place the output into <file>.
  557.  -pie                     Create a position independent executable.
  558.  -shared                  Create a shared library.
  559.  -x <language>            Specify the language of the following input files.
  560.                           Permissible languages include: c c++ assembler none
  561.                           'none' means revert to the default behavior of
  562.                           guessing the language based on the file's extension.
  563.  
  564. Options starting with -g, -f, -m, -O, -W, or --param are automatically
  565. passed on to the various sub-processes invoked by gcc.  In order to pass
  566. other options on to these processes the -W<letter> options must be used.
  567.  
  568. For bug reporting instructions, please see:
  569. <https://gcc.gnu.org/bugs/>.
  570. sh-4.4# g++ --help
  571. Usage: g++ [options] file...
  572. Options:
  573.  -pass-exit-codes         Exit with highest error code from a phase.
  574.  --help                   Display this information.
  575.  --target-help            Display target specific command line options.
  576.  --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].
  577.                            Display specific types of command line options.
  578.   (Use '-v --help' to display command line options of sub-processes).
  579.   --version                Display compiler version information.
  580.   -dumpspecs               Display all of the built in spec strings.
  581.   -dumpversion             Display the version of the compiler.
  582.   -dumpmachine             Display the compiler's target processor.
  583.   -print-search-dirs       Display the directories in the compiler's search path.
  584.   -print-libgcc-file-name  Display the name of the compiler's companion library.
  585.   -print-file-name=<lib>   Display the full path to library <lib>.
  586.   -print-prog-name=<prog>  Display the full path to compiler component <prog>.
  587.   -print-multiarch         Display the target's normalized GNU triplet, used as
  588.                            a component in the library path.
  589.   -print-multi-directory   Display the root directory for versions of libgcc.
  590.   -print-multi-lib         Display the mapping between command line options and
  591.                            multiple library search directories.
  592.   -print-multi-os-directory Display the relative path to OS libraries.
  593.   -print-sysroot           Display the target libraries directory.
  594.   -print-sysroot-headers-suffix Display the sysroot suffix used to find headers.
  595.   -Wa,<options>            Pass comma-separated <options> on to the assembler.
  596.   -Wp,<options>            Pass comma-separated <options> on to the preprocessor.
  597.   -Wl,<options>            Pass comma-separated <options> on to the linker.
  598.   -Xassembler <arg>        Pass <arg> on to the assembler.
  599.   -Xpreprocessor <arg>     Pass <arg> on to the preprocessor.
  600.   -Xlinker <arg>           Pass <arg> on to the linker.
  601.   -save-temps              Do not delete intermediate files.
  602.   -save-temps=<arg>        Do not delete intermediate files.
  603.   -no-canonical-prefixes   Do not canonicalize paths when building relative
  604.                            prefixes to other gcc components.
  605.   -pipe                    Use pipes rather than intermediate files.
  606.   -time                    Time the execution of each subprocess.
  607.   -specs=<file>            Override built-in specs with the contents of <file>.
  608.   -std=<standard>          Assume that the input sources are for <standard>.
  609.   --sysroot=<directory>    Use <directory> as the root directory for headers
  610.                            and libraries.
  611.   -B <directory>           Add <directory> to the compiler's search paths.
  612.   -v                       Display the programs invoked by the compiler.
  613.   -###                     Like -v but options quoted and commands not executed.
  614.   -E                       Preprocess only; do not compile, assemble or link.
  615.   -S                       Compile only; do not assemble or link.
  616.   -c                       Compile and assemble, but do not link.
  617.   -o <file>                Place the output into <file>.
  618.   -pie                     Create a position independent executable.
  619.   -shared                  Create a shared library.
  620.   -x <language>            Specify the language of the following input files.
  621.                            Permissible languages include: c c++ assembler none
  622.                            'none' means revert to the default behavior of
  623.                            guessing the language based on the file's extension.
  624.  
  625. Options starting with -g, -f, -m, -O, -W, or --param are automatically
  626.  passed on to the various sub-processes invoked by g++.  In order to pass
  627.  other options on to these processes the -W<letter> options must be used.
  628.  
  629. For bug reporting instructions, please see:
  630. <https://gcc.gnu.org/bugs/>.
  631. sh-4.4#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement