diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-07 18:20:00 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-07 18:20:00 +0000 |
commit | 69969b8eafc4799a78edf2f2e11599265dd24dfd (patch) | |
tree | 2c96e910fa3ba7bc580fdfa153e3c9545f3aae83 /chrome/nacl | |
parent | 7f81cc7f06760f99b6c125b6fd72abdb04ccc73d (diff) | |
download | chromium_src-69969b8eafc4799a78edf2f2e11599265dd24dfd.zip chromium_src-69969b8eafc4799a78edf2f2e11599265dd24dfd.tar.gz chromium_src-69969b8eafc4799a78edf2f2e11599265dd24dfd.tar.bz2 |
Revert 99975 - nacl_helper_bootstrap: Avoid writable text segment
Using linux_syscall_support.h requires having a global variable
(for the local errno), which I did not have in my original version.
Hence, we now have bss space, where originally I had none at all.
This updates the linker script to have a proper data+bss segment.
Without this, the text segment winds up both writable and executable,
which is generally frowned upon (and requires extra special privileges
in some Linux systems).
BUG= none
TEST= hand-verified that the build comes out as intended and still works
R=bradchen@google.com
Review URL: http://codereview.chromium.org/7840012
TBR=mcgrathr@chromium.org
Review URL: http://codereview.chromium.org/7841038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl')
-rw-r--r-- | chrome/nacl/nacl_helper_bootstrap_linux.x | 16 | ||||
-rwxr-xr-x | chrome/nacl/nacl_helper_bootstrap_munge_phdr.py | 2 |
2 files changed, 1 insertions, 17 deletions
diff --git a/chrome/nacl/nacl_helper_bootstrap_linux.x b/chrome/nacl/nacl_helper_bootstrap_linux.x index 169bc0d..5eae077 100644 --- a/chrome/nacl/nacl_helper_bootstrap_linux.x +++ b/chrome/nacl/nacl_helper_bootstrap_linux.x @@ -46,7 +46,6 @@ RESERVE_TOP = 1 << 30; */ PHDRS { text PT_LOAD FILEHDR PHDRS; - data PT_LOAD; reserve PT_LOAD FLAGS(0); stack PT_GNU_STACK FLAGS(6); /* RW, no E */ } @@ -67,21 +66,6 @@ SECTIONS { etext = .; /* - * Adjust the address for the data segment. We want to adjust up to - * the same address within the page on the next page up. - */ - . = (ALIGN(CONSTANT(MAXPAGESIZE)) - - ((CONSTANT(MAXPAGESIZE) - .) & (CONSTANT(MAXPAGESIZE) - 1))); - . = DATA_SEGMENT_ALIGN(CONSTANT(MAXPAGESIZE), CONSTANT(COMMONPAGESIZE)); - - .data : { - *(.data*) - } :data - .bss : { - *(.bss*) - } - - /* * Now we move up to the next p_align increment, and place the dummy * segment there. The linker emits this segment with the p_vaddr and * p_memsz we want, which reserves the address space. But the linker diff --git a/chrome/nacl/nacl_helper_bootstrap_munge_phdr.py b/chrome/nacl/nacl_helper_bootstrap_munge_phdr.py index 7a53374..c3a3931 100755 --- a/chrome/nacl/nacl_helper_bootstrap_munge_phdr.py +++ b/chrome/nacl/nacl_helper_bootstrap_munge_phdr.py @@ -28,7 +28,7 @@ def Main(argv): [prog, munger, infile, outfile] = argv tmpfile = outfile + '.tmp' shutil.copy(infile, tmpfile) - segment_num = '2' + segment_num = '1' subprocess.check_call([munger, tmpfile, segment_num]) shutil.move(tmpfile, outfile) |