小编Ran*_*Guy的帖子

将 .text 部分放在 ELF 的最后

出于特定原因,我需要将.text部分放在 ELF 文件的最后。

我试图以这种方式实现这一目标:

我采用了默认的大链接脚本并将.text部分移到了部分的最后SECTIONS { ... }

$ readelf -S beronew

[ #] Name               Type            Address            Offset
     Size              Size.Ent         Flags     -     -  Alignment
[ 0]                   NULL             0000000000000000  00000000
     0000000000000000  0000000000000000           0     0     0
[ 1] .data             PROGBITS         00000000006000b0  000000b0
     000000000000003b  0000000000000000  WA       0     0     1
[ 2] .text             PROGBITS         0000000000a000f0  000000f0
     00000000000003e9  0000000000000000  AX       0     0     1
[ 3] .shstrtab         STRTAB           0000000000000000  000004d9
     0000000000000027  0000000000000000           0     0     1
[ 4] .symtab           SYMTAB           0000000000000000 …
Run Code Online (Sandbox Code Playgroud)

linux assembly gcc elf ld

5
推荐指数
1
解决办法
3067
查看次数

在 Jetty 上为 Spring Boot 启用 HTTP/2

我有一个带有嵌入式 jetty 的 Spring Boot 2.0.0 RC2,我想启用 HTTP/2。

根据有关如何为 jetty 启用 http/2 的文档,我添加server.http2.enabled=true到了我的apllication.properties

我的pom.xml看起来像这样:

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.RC2</version>
        <relativePath/> <!-- lookup parent from repository -->
</parent>

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <!-- Exclude the Tomcat dependency -->
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Use Jetty instead -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jetty</artifactId>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-alpn-conscrypt-server -->
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-alpn-conscrypt-server</artifactId>
            <version>9.4.8.v20171121</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.eclipse.jetty.http2/http2-server -->
        <dependency>
            <groupId>org.eclipse.jetty.http2</groupId>
            <artifactId>http2-server</artifactId>
            <version>9.4.8.v20171121</version>
        </dependency>

</dependencies>
Run Code Online (Sandbox Code Playgroud)

然后我启动它并执行一些 GET 请求(第一个是 HTTP1,第二个是 …

java spring jetty spring-boot

5
推荐指数
1
解决办法
6792
查看次数

标签 统计

assembly ×1

elf ×1

gcc ×1

java ×1

jetty ×1

ld ×1

linux ×1

spring ×1

spring-boot ×1