Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Building with debug symbols
2019-02-27, 01:12
Post: #4
RE: Building with debug symbols
Digging in to this a bit more found in src/Makefile.efl line 9 LDFLAGS += -q -S

-S tells the linker to strip Omit debugger symbol information (but not all symbols) from the output file.

However when build with the -S flag I get

ld -m elf_x86_64 -q --gc-sections -static -T scripts/efi.lds -u _efi_start --defsym check__efi_start=_efi_start -u obj_snp --defsym check_obj_snp=obj_snp -u obj_intelx --defsym c\
heck_obj_intelx=obj_intelx -u obj_config --defsym check_obj_config=obj_config -u obj_config_efi --defsym check_obj_config_efi=obj_config_efi --defsym pci_vendor_id=0 --defsym pci_dev\
ice_id=0 -e _efi_start bin-x86_64-efi/version.snp--intelx.efi.o bin-x86_64-efi/blib.a -o bin-x86_64-efi/snp--intelx.efi.tmp \
--defsym _build_id=`perl -e 'printf "0x%08x", int ( rand ( 0xffffffff ) );'` \
--defsym _build_timestamp=1551225293 \
-Map bin-x86_64-efi/snp--intelx.efi.tmp.map
objdump -ht bin-x86_64-efi/snp--intelx.efi.tmp | perl ./util/sortobjdump.pl >> bin-x86_64-efi/snp--intelx.efi.tmp.map
./util/elf2efi64 --subsystem=10 bin-x86_64-efi/snp--intelx.efi.tmp bin-x86_64-efi/snp--intelx.efi
Unrecognised relocation type 10
Makefile.efi:25: recipe for target 'bin-x86_64-efi/snp--intelx.efi' failed
make[2]: *** [bin-x86_64-efi/snp--intelx.efi] Error 1
rm bin-x86_64-efi/version.snp--intelx.efi.o



snp--intelx.efi.tmp now has debug symbols
ericb@bsdpemulator-01:~/SystemReprovisioningTools/ZeroTouchOS$ gdb ipxe/src/bin-x86_64-efi/snp--intelx.efi.tmp
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright © 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ipxe/src/bin-x86_64-efi/snp--intelx.efi.tmp...done.
(gdb) list
14
15 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
16
17 #include <stddef.h>
18 #include <stdio.h>
19 #include <ipxe/init.h>
20 #include <ipxe/version.h>
21 #include <usr/autoboot.h>
22
23 /**
(gdb) list main
23 /**
24 * Main entry point
25 *
26 * @ret rc Return status code
27 */
28 __asmcall int main ( void ) {
29 int rc;
30
31 /* Perform one-time-only initialisation (e.g. heap) */
32 initialise();

If add -S to LDFLAGS the build completes but no debug symbols in the binaries.

/util/elf2efi64 seems to application having an issue.

/util/elf2efi64 --subsystem=10 bin-x86_64-efi/snp--intelx.efi.tmp bin-x86_64-efi/snp--intelx.efi
Unrecognised relocation type 10
Makefile.efi:25: recipe for target 'bin-x86_64-efi/snp--intelx.efi' failed
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Building with debug symbols - ebruno - 2019-02-04, 17:12
RE: Building with debug symbols - ebruno - 2019-02-27 01:12



User(s) browsing this thread: 1 Guest(s)