[LibOS, Pal] add .file directive to .S file to make debug easier

gas includes dwarf info about compilation unit into .o compiled
from .S. Hoever, without .file directive, gnu linker drops dwarf
compilation unit info about .S. from .so (libpal.so libsysdb.so).
As result gdb fails to open .S when debugging .S file.
Add .file directive to .S files to make debug .S easier.

My ld version is
> $ ld --version
> GNU ld (GNU Binutils for Ubuntu) 2.30

Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
This commit is contained in:
Isaku Yamahata
2019-08-05 17:30:20 -07:00
parent f53c3afd95
commit e8327f1600
9 changed files with 13 additions and 0 deletions
+1
View File
@@ -16,6 +16,7 @@
...
NULL
*/
.file "start.S"
.text
.globl shim_start
.type shim_start,@function
+1
View File
@@ -24,6 +24,7 @@
#include "asm-offsets.h"
.file "syscallas.S"
.global syscalldb
.type syscalldb, @function
.extern shim_table, debug_unsupp
+1
View File
@@ -1,3 +1,4 @@
.file "vdso-data.S"
.section .rodata
.global vdso_so
+1
View File
@@ -1,3 +1,4 @@
.file "vdso-note.S"
/* This .note section informs dynamic linker about vDSO */
.section .note.Linux, "a", @note
+2
View File
@@ -1,6 +1,8 @@
#include "sgx_arch.h"
#include "asm-offsets.h"
.file "enclave_entry.S"
# In some cases, like bogus parameters passed to enclave_entry, it's tricky to
# return cleanly (passing the correct return address to EEXIT, OCALL_EXIT can
# be interrupted, etc.). Since those cases should only ever happen with a
+2
View File
@@ -3,6 +3,8 @@
#include "asm-offsets.h"
.file "sgx_entry.S"
.extern tcs_base
.global sgx_ecall
+2
View File
@@ -30,6 +30,8 @@
#include "sysdep-x86_64.h"
.file "clone-x86_64.S"
#define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000
+2
View File
@@ -26,6 +26,8 @@
#include "sysdep-x86_64.h"
.file "gettimeofday-x86_64.S"
/* For the calculation see asm/vsyscall.h. */
#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
+1
View File
@@ -17,6 +17,7 @@
NULL
*/
.file "user_start.S"
.text
.globl _start
.type _start,@function