Print this page
10366 ld(1) should support GNU-style linker sets
10581 ld(1) should know kernel modules are a thing

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/libld/common/sections.c
          +++ new/usr/src/cmd/sgs/libld/common/sections.c
↓ open down ↓ 1266 lines elided ↑ open up ↑
1267 1267                  if (ofl->ofl_oscapchain)
1268 1268                          cnt += 3;
1269 1269  
1270 1270                  if (flags & FLG_OF_SYMBOLIC)
1271 1271                          cnt++;                  /* DT_SYMBOLIC */
1272 1272  
1273 1273                  if (ofl->ofl_aslr != 0)         /* DT_SUNW_ASLR */
1274 1274                          cnt++;
1275 1275          }
1276 1276  
     1277 +        /* DT_SUNW_KMOD */
     1278 +        if (ofl->ofl_flags & FLG_OF_KMOD)
     1279 +                cnt++;
     1280 +
1277 1281          /*
1278 1282           * Account for Architecture dependent .dynamic entries, and defaults.
1279 1283           */
1280 1284          (*ld_targ.t_mr.mr_mach_make_dynamic)(ofl, &cnt);
1281 1285  
1282 1286          /*
1283 1287           * DT_FLAGS, DT_FLAGS_1, DT_SUNW_STRPAD, and DT_NULL. Also,
1284 1288           * allow room for the unused extra DT_NULLs. These are included
1285 1289           * to allow an ELF editor room to add items later.
1286 1290           */
↓ open down ↓ 1138 lines elided ↑ open up ↑
2425 2429   * for an executable and/or a shared object.
2426 2430   */
2427 2431  static uintptr_t
2428 2432  make_reloc(Ofl_desc *ofl, Os_desc *osp)
2429 2433  {
2430 2434          Shdr            *shdr;
2431 2435          Elf_Data        *data;
2432 2436          Is_desc         *isec;
2433 2437          size_t          size;
2434 2438          Xword           sh_flags;
2435      -        char            *sectname;
     2439 +        char            *sectname;
2436 2440          Os_desc         *rosp;
2437 2441          Word            relsize;
2438 2442          const char      *rel_prefix;
2439 2443  
2440 2444          /* LINTED */
2441 2445          if (ld_targ.t_m.m_rel_sht_type == SHT_REL) {
2442 2446                  /* REL */
2443 2447                  relsize = sizeof (Rel);
2444 2448                  rel_prefix = MSG_ORIG(MSG_SCN_REL);
2445 2449          } else {
↓ open down ↓ 210 lines elided ↑ open up ↑
2656 2660   * Make .sunwmove section
2657 2661   */
2658 2662  uintptr_t
2659 2663  ld_make_sunwmove(Ofl_desc *ofl, int mv_nums)
2660 2664  {
2661 2665          Shdr            *shdr;
2662 2666          Elf_Data        *data;
2663 2667          Is_desc         *isec;
2664 2668          Aliste          idx;
2665 2669          Sym_desc        *sdp;
2666      -        int             cnt = 1;
     2670 +        int             cnt = 1;
2667 2671  
2668 2672  
2669 2673          if (new_section(ofl, SHT_SUNW_move, MSG_ORIG(MSG_SCN_SUNWMOVE),
2670 2674              mv_nums, &isec, &shdr, &data) == S_ERROR)
2671 2675                  return (S_ERROR);
2672 2676  
2673 2677          if ((data->d_buf = libld_calloc(data->d_size, 1)) == NULL)
2674 2678                  return (S_ERROR);
2675 2679  
2676 2680          /*
↓ open down ↓ 852 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX